diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e0e37e75014128..7b9eb81a31d335 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -164,6 +164,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml \ 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/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/scripts/rules.matterlint b/scripts/rules.matterlint index 7c9e6466d5418b..9aac905e0db834 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -47,6 +47,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster 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/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 84a57c7c987f5c..fbc8b1f5d80857 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -46,6 +46,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 new file mode 100644 index 00000000000000..de156b7a726041 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + General + Operational State + 0x0060 + OPERATIONAL_STATE_CLUSTER + true + true + This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. + + + + 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 fcc8ae60ab24f3..adccb7f9b85a46 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -64,6 +64,7 @@ "onoff-cluster.xml", "onoff-switch-configuration-cluster.xml", "operational-credentials-cluster.xml", + "operational-state-cluster.xml", "pressure-measurement-cluster.xml", "power-source-cluster.xml", "power-source-configuration-cluster.xml", @@ -290,7 +291,8 @@ "UTCTime", "LocalTime" ], - "Temperature Control": ["SupportedTemperatureLevels"] + "Temperature Control": ["SupportedTemperatureLevels"], + "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 4ef9f890e322d6..89243b4dbb0daa 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -62,6 +62,7 @@ "onoff-cluster.xml", "onoff-switch-configuration-cluster.xml", "operational-credentials-cluster.xml", + "operational-state-cluster.xml", "pressure-measurement-cluster.xml", "power-source-cluster.xml", "power-source-configuration-cluster.xml", @@ -288,7 +289,8 @@ "UTCTime", "LocalTime" ], - "Temperature Control": ["SupportedTemperatureLevels"] + "Temperature Control": ["SupportedTemperatureLevels"], + "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 a5d1237868d5a1..3a5d1470a3e916 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -81,6 +81,7 @@ "ON_OFF_CLUSTER": [], "ON_OFF_SWITCH_CONFIGURATION_CLUSTER": [], "OPERATIONAL_CREDENTIALS_CLUSTER": [], + "OPERATIONAL_STATE_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 83e90ecad8809c..8d2290f0d666af 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -156,6 +156,8 @@ if (current_os == "android" || build_java_matter_controller) { "jni/OtaSoftwareUpdateRequestorClient-ReadImpl.cpp", "jni/OzoneFilterMonitoringClient-InvokeSubscribeImpl.cpp", "jni/OzoneFilterMonitoringClient-ReadImpl.cpp", + "jni/OperationalStateClient-InvokeSubscribeImpl.cpp", + "jni/OperationalStateClient-ReadImpl.cpp", "jni/PowerSourceClient-InvokeSubscribeImpl.cpp", "jni/PowerSourceClient-ReadImpl.cpp", "jni/PowerSourceConfigurationClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index ea82d27ad379d5..4ee17e93b1ef8f 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2978,6 +2978,70 @@ client cluster SmokeCoAlarm = 92 { command SelfTestRequest(): DefaultSuccess = 0; } +/** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */ +client cluster OperationalState = 96 { + enum ErrorStateEnum : ENUM8 { + kNoError = 0; + kUnableToStartOrResume = 1; + kUnableToCompleteOperation = 2; + kCommandInvalidInState = 3; + } + + enum OperationalStateEnum : ENUM8 { + kStopped = 0; + kRunning = 1; + kPaused = 2; + kError = 3; + } + + struct ErrorStateStruct { + ErrorStateEnum errorStateID = 0; + nullable char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; + } + + struct OperationalStateStruct { + OperationalStateEnum operationalStateID = 0; + char_string<64> operationalStateLabel = 1; + } + + critical event OperationalError = 0 { + ErrorStateStruct errorState = 0; + } + + info event OperationCompletion = 1 { + ErrorStateEnum 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; +} + /** Attributes and commands for monitoring HEPA filters in a device */ client cluster HepaFilterMonitoring = 113 { enum ChangeIndicationEnum : ENUM8 { diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index e57bcc59fae969..4f2c87f31896e2 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -7991,7 +7991,7 @@ "enabled": 1, "commands": [ { - "name": "SetUtcTime", + "name": "SetUTCTime", "code": 0, "mfgCode": null, "source": "client", @@ -11425,6 +11425,250 @@ } ] }, + { + "name": "Operational State", + "code": 96, + "mfgCode": null, + "define": "OPERATIONAL_STATE_CLUSTER", + "side": "client", + "enabled": 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": "Operational State", + "code": 96, + "mfgCode": null, + "define": "OPERATIONAL_STATE_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "PhaseList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "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": "RAM", + "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": "RAM", + "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": "RAM", + "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": "RAM", + "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": "RAM", + "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": "RAM", + "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": "RAM", + "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 + } + ] + }, { "name": "HEPA Filter Monitoring", "code": 113, @@ -20578,7 +20822,7 @@ ] }, { - "name": "Carbon Monoxide Measurement", + "name": "Carbon Monoxide Concentration Measurement", "code": 1036, "mfgCode": null, "define": "CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -20620,7 +20864,7 @@ ] }, { - "name": "Carbon Monoxide Measurement", + "name": "Carbon Monoxide Concentration Measurement", "code": 1036, "mfgCode": null, "define": "CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -20696,7 +20940,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -20728,7 +20972,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -20760,7 +21004,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -20776,7 +21020,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -20792,7 +21036,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -20810,7 +21054,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -20826,7 +21070,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -20842,7 +21086,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -20858,7 +21102,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -20902,7 +21146,7 @@ ] }, { - "name": "Carbon Dioxide Measurement", + "name": "Carbon Dioxide Concentration Measurement", "code": 1037, "mfgCode": null, "define": "CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -20944,7 +21188,7 @@ ] }, { - "name": "Carbon Dioxide Measurement", + "name": "Carbon Dioxide Concentration Measurement", "code": 1037, "mfgCode": null, "define": "CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -21020,7 +21264,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21052,7 +21296,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21084,7 +21328,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21100,7 +21344,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21116,7 +21360,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21134,7 +21378,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21150,7 +21394,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21166,7 +21410,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21182,7 +21426,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21226,7 +21470,7 @@ ] }, { - "name": "Ethylene Measurement", + "name": "Ethylene Concentration Measurement", "code": 1038, "mfgCode": null, "define": "ETHYLENE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -21268,7 +21512,7 @@ ] }, { - "name": "Ethylene Measurement", + "name": "Ethylene Concentration Measurement", "code": 1038, "mfgCode": null, "define": "ETHYLENE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -21344,7 +21588,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21376,7 +21620,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21408,7 +21652,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21424,7 +21668,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21440,7 +21684,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21458,7 +21702,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21474,7 +21718,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21490,7 +21734,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21506,7 +21750,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21550,7 +21794,7 @@ ] }, { - "name": "Ethylene Oxide Measurement", + "name": "Ethylene Oxide Concentration Measurement", "code": 1039, "mfgCode": null, "define": "ETHYLENE_OXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -21592,7 +21836,7 @@ ] }, { - "name": "Ethylene Oxide Measurement", + "name": "Ethylene Oxide Concentration Measurement", "code": 1039, "mfgCode": null, "define": "ETHYLENE_OXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -21668,7 +21912,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21700,7 +21944,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21732,7 +21976,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21748,7 +21992,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21764,7 +22008,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -21782,7 +22026,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21798,7 +22042,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21814,7 +22058,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21830,7 +22074,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21874,7 +22118,7 @@ ] }, { - "name": "Hydrogen Measurement", + "name": "Hydrogen Concentration Measurement", "code": 1040, "mfgCode": null, "define": "HYDROGEN_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -21916,7 +22160,7 @@ ] }, { - "name": "Hydrogen Measurement", + "name": "Hydrogen Concentration Measurement", "code": 1040, "mfgCode": null, "define": "HYDROGEN_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -21992,7 +22236,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22024,7 +22268,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22056,7 +22300,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22072,7 +22316,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22088,7 +22332,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22106,7 +22350,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22122,7 +22366,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22138,7 +22382,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22154,7 +22398,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22198,7 +22442,7 @@ ] }, { - "name": "Hydrogen Sulfide Measurement", + "name": "Hydrogen Sulfide Concentration Measurement", "code": 1041, "mfgCode": null, "define": "HYDROGEN_SULFIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -22240,7 +22484,7 @@ ] }, { - "name": "Hydrogen Sulfide Measurement", + "name": "Hydrogen Sulfide Concentration Measurement", "code": 1041, "mfgCode": null, "define": "HYDROGEN_SULFIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -22316,7 +22560,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22348,7 +22592,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22380,7 +22624,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22396,7 +22640,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22412,7 +22656,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22430,7 +22674,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22446,7 +22690,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22462,7 +22706,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22478,7 +22722,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22522,7 +22766,7 @@ ] }, { - "name": "Nitric Oxide Measurement", + "name": "Nitric Oxide Concentration Measurement", "code": 1042, "mfgCode": null, "define": "NITRIC_OXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -22564,7 +22808,7 @@ ] }, { - "name": "Nitric Oxide Measurement", + "name": "Nitric Oxide Concentration Measurement", "code": 1042, "mfgCode": null, "define": "NITRIC_OXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -22640,7 +22884,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22672,7 +22916,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22704,7 +22948,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22720,7 +22964,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22736,7 +22980,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22754,7 +22998,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22770,7 +23014,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22786,7 +23030,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22802,7 +23046,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22846,7 +23090,7 @@ ] }, { - "name": "Nitrogen Dioxide Measurement", + "name": "Nitrogen Dioxide Concentration Measurement", "code": 1043, "mfgCode": null, "define": "NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -22888,7 +23132,7 @@ ] }, { - "name": "Nitrogen Dioxide Measurement", + "name": "Nitrogen Dioxide Concentration Measurement", "code": 1043, "mfgCode": null, "define": "NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -22964,7 +23208,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22996,7 +23240,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23028,7 +23272,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23044,7 +23288,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23060,7 +23304,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23078,7 +23322,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23094,7 +23338,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23110,7 +23354,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23126,7 +23370,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23170,7 +23414,7 @@ ] }, { - "name": "Oxygen Measurement", + "name": "Oxygen Concentration Measurement", "code": 1044, "mfgCode": null, "define": "OXYGEN_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -23212,7 +23456,7 @@ ] }, { - "name": "Oxygen Measurement", + "name": "Oxygen Concentration Measurement", "code": 1044, "mfgCode": null, "define": "OXYGEN_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -23288,7 +23532,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23320,7 +23564,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23352,7 +23596,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23368,7 +23612,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23384,7 +23628,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23402,7 +23646,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23418,7 +23662,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23434,7 +23678,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23450,7 +23694,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23494,7 +23738,7 @@ ] }, { - "name": "Ozone Measurement", + "name": "Ozone Concentration Measurement", "code": 1045, "mfgCode": null, "define": "OZONE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -23536,7 +23780,7 @@ ] }, { - "name": "Ozone Measurement", + "name": "Ozone Concentration Measurement", "code": 1045, "mfgCode": null, "define": "OZONE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -23612,7 +23856,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23644,7 +23888,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23676,7 +23920,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23692,7 +23936,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23708,7 +23952,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23726,7 +23970,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23742,7 +23986,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23758,7 +24002,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23774,7 +24018,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23818,7 +24062,7 @@ ] }, { - "name": "Sulfur Dioxide Measurement", + "name": "Sulfur Dioxide Concentration Measurement", "code": 1046, "mfgCode": null, "define": "SULFUR_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -23860,7 +24104,7 @@ ] }, { - "name": "Sulfur Dioxide Measurement", + "name": "Sulfur Dioxide Concentration Measurement", "code": 1046, "mfgCode": null, "define": "SULFUR_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -23936,7 +24180,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -23968,7 +24212,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24000,7 +24244,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24016,7 +24260,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24032,7 +24276,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24050,7 +24294,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -24066,7 +24310,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -24082,7 +24326,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -24098,7 +24342,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -24142,7 +24386,7 @@ ] }, { - "name": "Dissolved Oxygen Measurement", + "name": "Dissolved Oxygen Concentration Measurement", "code": 1047, "mfgCode": null, "define": "DISSOLVED_OXYGEN_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -24184,7 +24428,7 @@ ] }, { - "name": "Dissolved Oxygen Measurement", + "name": "Dissolved Oxygen Concentration Measurement", "code": 1047, "mfgCode": null, "define": "DISSOLVED_OXYGEN_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -24260,7 +24504,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24292,7 +24536,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24324,7 +24568,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24340,7 +24584,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24356,7 +24600,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24374,7 +24618,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -24390,7 +24634,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -24406,7 +24650,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -24422,7 +24666,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -24466,7 +24710,7 @@ ] }, { - "name": "Bromate Measurement", + "name": "Bromate Concentration Measurement", "code": 1048, "mfgCode": null, "define": "BROMATE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -24508,7 +24752,7 @@ ] }, { - "name": "Bromate Measurement", + "name": "Bromate Concentration Measurement", "code": 1048, "mfgCode": null, "define": "BROMATE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -24584,7 +24828,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24616,7 +24860,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24648,7 +24892,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24664,7 +24908,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24680,7 +24924,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24698,7 +24942,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -24714,7 +24958,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -24730,7 +24974,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -24746,7 +24990,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -24790,7 +25034,7 @@ ] }, { - "name": "Chloramines Measurement", + "name": "Chloramines Concentration Measurement", "code": 1049, "mfgCode": null, "define": "CHLORAMINES_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -24832,7 +25076,7 @@ ] }, { - "name": "Chloramines Measurement", + "name": "Chloramines Concentration Measurement", "code": 1049, "mfgCode": null, "define": "CHLORAMINES_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -24908,7 +25152,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24940,7 +25184,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24972,7 +25216,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24988,7 +25232,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25004,7 +25248,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25022,7 +25266,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -25038,7 +25282,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -25054,7 +25298,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -25070,7 +25314,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -25114,7 +25358,7 @@ ] }, { - "name": "Chlorine Measurement", + "name": "Chlorine Concentration Measurement", "code": 1050, "mfgCode": null, "define": "CHLORINE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -25156,7 +25400,7 @@ ] }, { - "name": "Chlorine Measurement", + "name": "Chlorine Concentration Measurement", "code": 1050, "mfgCode": null, "define": "CHLORINE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -25232,7 +25476,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25264,7 +25508,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25296,7 +25540,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25312,7 +25556,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25328,7 +25572,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25346,7 +25590,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -25362,7 +25606,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -25378,7 +25622,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -25394,7 +25638,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -25438,7 +25682,7 @@ ] }, { - "name": "Fecal coliform & E. Coli Measurement", + "name": "Fecal coliform & E. Coli Concentration Measurement", "code": 1051, "mfgCode": null, "define": "FECAL_COLIFORM_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -25480,7 +25724,7 @@ ] }, { - "name": "Fecal coliform & E. Coli Measurement", + "name": "Fecal coliform & E. Coli Concentration Measurement", "code": 1051, "mfgCode": null, "define": "FECAL_COLIFORM_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -25556,7 +25800,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25588,7 +25832,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25620,7 +25864,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25636,7 +25880,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25652,7 +25896,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25670,7 +25914,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -25686,7 +25930,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -25702,7 +25946,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -25718,7 +25962,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -25762,7 +26006,7 @@ ] }, { - "name": "Fluoride Measurement", + "name": "Fluoride Concentration Measurement", "code": 1052, "mfgCode": null, "define": "FLUORIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -25804,7 +26048,7 @@ ] }, { - "name": "Fluoride Measurement", + "name": "Fluoride Concentration Measurement", "code": 1052, "mfgCode": null, "define": "FLUORIDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -25880,7 +26124,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25912,7 +26156,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25944,7 +26188,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25960,7 +26204,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25976,7 +26220,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -25994,7 +26238,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26010,7 +26254,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26026,7 +26270,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26042,7 +26286,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26086,7 +26330,7 @@ ] }, { - "name": "Haloacetic Acids Measurement", + "name": "Haloacetic Acids Concentration Measurement", "code": 1053, "mfgCode": null, "define": "HALOACETIC_ACIDS_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -26128,7 +26372,7 @@ ] }, { - "name": "Haloacetic Acids Measurement", + "name": "Haloacetic Acids Concentration Measurement", "code": 1053, "mfgCode": null, "define": "HALOACETIC_ACIDS_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -26204,7 +26448,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26236,7 +26480,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26268,7 +26512,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26284,7 +26528,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26300,7 +26544,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26318,7 +26562,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26334,7 +26578,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26350,7 +26594,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26366,7 +26610,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26410,7 +26654,7 @@ ] }, { - "name": "Total Trihalomethanes Measurement", + "name": "Total Trihalomethanes Concentration Measurement", "code": 1054, "mfgCode": null, "define": "TOTAL_TRIHALOMETHANES_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -26452,7 +26696,7 @@ ] }, { - "name": "Total Trihalomethanes Measurement", + "name": "Total Trihalomethanes Concentration Measurement", "code": 1054, "mfgCode": null, "define": "TOTAL_TRIHALOMETHANES_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -26528,7 +26772,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26560,7 +26804,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26592,7 +26836,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26608,7 +26852,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26624,7 +26868,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26642,7 +26886,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26658,7 +26902,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26674,7 +26918,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26690,7 +26934,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26734,7 +26978,7 @@ ] }, { - "name": "Total Coliform Bacteria Measurement", + "name": "Total Coliform Bacteria Concentration Measurement", "code": 1055, "mfgCode": null, "define": "TOTAL_COLIFORM_BACTERIA_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -26776,7 +27020,7 @@ ] }, { - "name": "Total Coliform Bacteria Measurement", + "name": "Total Coliform Bacteria Concentration Measurement", "code": 1055, "mfgCode": null, "define": "TOTAL_COLIFORM_BACTERIA_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -26852,7 +27096,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26884,7 +27128,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26916,7 +27160,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26932,7 +27176,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26948,7 +27192,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -26966,7 +27210,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26982,7 +27226,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -26998,7 +27242,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27014,7 +27258,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27058,7 +27302,7 @@ ] }, { - "name": "Turbidity Measurement", + "name": "Turbidity Concentration Measurement", "code": 1056, "mfgCode": null, "define": "TURBIDITY_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -27100,7 +27344,7 @@ ] }, { - "name": "Turbidity Measurement", + "name": "Turbidity Concentration Measurement", "code": 1056, "mfgCode": null, "define": "TURBIDITY_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -27176,7 +27420,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27208,7 +27452,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27240,7 +27484,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27256,7 +27500,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27272,7 +27516,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27290,7 +27534,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27306,7 +27550,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27322,7 +27566,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27338,7 +27582,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27382,7 +27626,7 @@ ] }, { - "name": "Copper Measurement", + "name": "Copper Concentration Measurement", "code": 1057, "mfgCode": null, "define": "COPPER_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -27424,7 +27668,7 @@ ] }, { - "name": "Copper Measurement", + "name": "Copper Concentration Measurement", "code": 1057, "mfgCode": null, "define": "COPPER_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -27500,7 +27744,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27532,7 +27776,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27564,7 +27808,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27580,7 +27824,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27596,7 +27840,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27614,7 +27858,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27630,7 +27874,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27646,7 +27890,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27662,7 +27906,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27706,7 +27950,7 @@ ] }, { - "name": "Lead Measurement", + "name": "Lead Concentration Measurement", "code": 1058, "mfgCode": null, "define": "LEAD_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -27748,7 +27992,7 @@ ] }, { - "name": "Lead Measurement", + "name": "Lead Concentration Measurement", "code": 1058, "mfgCode": null, "define": "LEAD_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -27824,7 +28068,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27856,7 +28100,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27888,7 +28132,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27904,7 +28148,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27920,7 +28164,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -27938,7 +28182,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27954,7 +28198,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27970,7 +28214,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -27986,7 +28230,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -28030,7 +28274,7 @@ ] }, { - "name": "Manganese Measurement", + "name": "Manganese Concentration Measurement", "code": 1059, "mfgCode": null, "define": "MANGANESE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -28072,7 +28316,7 @@ ] }, { - "name": "Manganese Measurement", + "name": "Manganese Concentration Measurement", "code": 1059, "mfgCode": null, "define": "MANGANESE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -28148,7 +28392,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28180,7 +28424,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28212,7 +28456,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28228,7 +28472,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28244,7 +28488,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28262,7 +28506,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -28278,7 +28522,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -28294,7 +28538,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -28310,7 +28554,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -28354,7 +28598,7 @@ ] }, { - "name": "Sulfate Measurement", + "name": "Sulfate Concentration Measurement", "code": 1060, "mfgCode": null, "define": "SULFATE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -28396,7 +28640,7 @@ ] }, { - "name": "Sulfate Measurement", + "name": "Sulfate Concentration Measurement", "code": 1060, "mfgCode": null, "define": "SULFATE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -28472,7 +28716,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28504,7 +28748,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28536,7 +28780,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28552,7 +28796,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28568,7 +28812,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28586,7 +28830,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -28602,7 +28846,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -28618,7 +28862,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -28634,7 +28878,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -28678,7 +28922,7 @@ ] }, { - "name": "Bromodichloromethane Measurement", + "name": "Bromodichloromethane Concentration Measurement", "code": 1061, "mfgCode": null, "define": "BROMODICHLOROMETHANE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -28720,7 +28964,7 @@ ] }, { - "name": "Bromodichloromethane Measurement", + "name": "Bromodichloromethane Concentration Measurement", "code": 1061, "mfgCode": null, "define": "BROMODICHLOROMETHANE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -28796,7 +29040,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28828,7 +29072,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28860,7 +29104,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28876,7 +29120,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28892,7 +29136,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -28910,7 +29154,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -28926,7 +29170,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -28942,7 +29186,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -28958,7 +29202,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29002,7 +29246,7 @@ ] }, { - "name": "Bromoform Measurement", + "name": "Bromoform Concentration Measurement", "code": 1062, "mfgCode": null, "define": "BROMOFORM_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -29044,7 +29288,7 @@ ] }, { - "name": "Bromoform Measurement", + "name": "Bromoform Concentration Measurement", "code": 1062, "mfgCode": null, "define": "BROMOFORM_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -29120,7 +29364,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29152,7 +29396,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29184,7 +29428,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29200,7 +29444,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29216,7 +29460,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29234,7 +29478,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29250,7 +29494,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29266,7 +29510,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29282,7 +29526,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29326,7 +29570,7 @@ ] }, { - "name": "Chlorodibromomethane Measurement", + "name": "Chlorodibromomethane Concentration Measurement", "code": 1063, "mfgCode": null, "define": "CHLORODIBROMOMETHANE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -29368,7 +29612,7 @@ ] }, { - "name": "Chlorodibromomethane Measurement", + "name": "Chlorodibromomethane Concentration Measurement", "code": 1063, "mfgCode": null, "define": "CHLORODIBROMOMETHANE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -29444,7 +29688,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29476,7 +29720,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29508,7 +29752,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29524,7 +29768,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29540,7 +29784,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29558,7 +29802,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29574,7 +29818,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29590,7 +29834,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29606,7 +29850,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29650,7 +29894,7 @@ ] }, { - "name": "Chloroform Measurement", + "name": "Chloroform Concentration Measurement", "code": 1064, "mfgCode": null, "define": "CHLOROFORM_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -29692,7 +29936,7 @@ ] }, { - "name": "Chloroform Measurement", + "name": "Chloroform Concentration Measurement", "code": 1064, "mfgCode": null, "define": "CHLOROFORM_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -29768,7 +30012,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29800,7 +30044,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29832,7 +30076,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29848,7 +30092,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29864,7 +30108,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -29882,7 +30126,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29898,7 +30142,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29914,7 +30158,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29930,7 +30174,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -29974,7 +30218,7 @@ ] }, { - "name": "Sodium Measurement", + "name": "Sodium Concentration Measurement", "code": 1065, "mfgCode": null, "define": "SODIUM_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -30016,7 +30260,7 @@ ] }, { - "name": "Sodium Measurement", + "name": "Sodium Concentration Measurement", "code": 1065, "mfgCode": null, "define": "SODIUM_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -30092,7 +30336,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30124,7 +30368,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30156,7 +30400,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30172,7 +30416,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30188,7 +30432,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30206,7 +30450,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -30222,7 +30466,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -30238,7 +30482,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -30254,7 +30498,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -30298,7 +30542,7 @@ ] }, { - "name": "PM2.5 Measurement", + "name": "PM2.5 Concentration Measurement", "code": 1066, "mfgCode": null, "define": "PM2_5_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -30340,7 +30584,7 @@ ] }, { - "name": "PM2.5 Measurement", + "name": "PM2.5 Concentration Measurement", "code": 1066, "mfgCode": null, "define": "PM2_5_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -30416,7 +30660,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30448,7 +30692,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30480,7 +30724,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30496,7 +30740,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30512,7 +30756,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30530,7 +30774,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -30546,7 +30790,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -30562,7 +30806,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -30578,7 +30822,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -30622,7 +30866,7 @@ ] }, { - "name": "Formaldehyde Measurement", + "name": "Formaldehyde Concentration Measurement", "code": 1067, "mfgCode": null, "define": "FORMALDEHYDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -30664,7 +30908,7 @@ ] }, { - "name": "Formaldehyde Measurement", + "name": "Formaldehyde Concentration Measurement", "code": 1067, "mfgCode": null, "define": "FORMALDEHYDE_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -30740,7 +30984,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30772,7 +31016,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30804,7 +31048,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30820,7 +31064,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30836,7 +31080,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -30854,7 +31098,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -30870,7 +31114,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -30886,7 +31130,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -30902,7 +31146,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -30946,7 +31190,7 @@ ] }, { - "name": "PM1 Measurement", + "name": "PM1 Concentration Measurement", "code": 1068, "mfgCode": null, "define": "PM1_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -30988,7 +31232,7 @@ ] }, { - "name": "PM1 Measurement", + "name": "PM1 Concentration Measurement", "code": 1068, "mfgCode": null, "define": "PM1_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -31064,7 +31308,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31096,7 +31340,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31128,7 +31372,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31144,7 +31388,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31160,7 +31404,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31178,7 +31422,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -31194,7 +31438,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -31210,7 +31454,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -31226,7 +31470,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -31270,7 +31514,7 @@ ] }, { - "name": "PM10 Measurement", + "name": "PM10 Concentration Measurement", "code": 1069, "mfgCode": null, "define": "PM10_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -31312,7 +31556,7 @@ ] }, { - "name": "PM10 Measurement", + "name": "PM10 Concentration Measurement", "code": 1069, "mfgCode": null, "define": "PM10_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -31388,7 +31632,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31420,7 +31664,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31452,7 +31696,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31468,7 +31712,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31484,7 +31728,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31502,7 +31746,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -31518,7 +31762,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -31534,7 +31778,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -31550,7 +31794,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -31594,7 +31838,7 @@ ] }, { - "name": "Total Volatile Organic Compounds Measurement", + "name": "Total Volatile Organic Compounds Concentration Measurement", "code": 1070, "mfgCode": null, "define": "TVOC_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -31636,7 +31880,7 @@ ] }, { - "name": "Total Volatile Organic Compounds Measurement", + "name": "Total Volatile Organic Compounds Concentration Measurement", "code": 1070, "mfgCode": null, "define": "TVOC_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -31712,7 +31956,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31744,7 +31988,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31776,7 +32020,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31792,7 +32036,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31808,7 +32052,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -31826,7 +32070,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -31842,7 +32086,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -31858,7 +32102,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -31874,7 +32118,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -31918,7 +32162,7 @@ ] }, { - "name": "Radon Measurement", + "name": "Radon Concentration Measurement", "code": 1071, "mfgCode": null, "define": "RADON_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -31960,7 +32204,7 @@ ] }, { - "name": "Radon Measurement", + "name": "Radon Concentration Measurement", "code": 1071, "mfgCode": null, "define": "RADON_CONCENTRATION_MEASUREMENT_CLUSTER", @@ -32036,7 +32280,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -32068,7 +32312,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "elapsed_s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -32100,7 +32344,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "MeasurementUnitType", + "type": "MeasurementUnitEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -32116,7 +32360,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "MeasurementMediumType", + "type": "MeasurementMediumEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -32132,7 +32376,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "LevelValueType", + "type": "LevelValueEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -32150,7 +32394,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -32166,7 +32410,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -32182,7 +32426,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -32198,7 +32442,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -36938,5 +37182,6 @@ "endpointVersion": 1, "deviceIdentifier": 22 } - ] -} + ], + "log": [] +} \ No newline at end of file diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 44feb787102ab3..63b53c7ccae9a7 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -166,6 +166,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == SmokeCoAlarm.ID) { return new SmokeCoAlarm(); } + if (clusterId == OperationalState.ID) { + return new OperationalState(); + } if (clusterId == HepaFilterMonitoring.ID) { return new HepaFilterMonitoring(); } @@ -6782,6 +6785,118 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class OperationalState implements BaseCluster { + public static final long ID = 96L; + 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 09cf5141a29be2..acf9c51e4f5b1e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -6578,6 +6578,120 @@ private static Map readSmokeCoAlarmInteractionInfo() { return result; } + private static Map readOperationalStateInteractionInfo() { + Map result = new LinkedHashMap<>();Map readOperationalStatePhaseListCommandParams = new LinkedHashMap(); + InteractionInfo readOperationalStatePhaseListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalStateCluster) cluster).readPhaseListAttribute( + (ChipClusters.OperationalStateCluster.PhaseListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedOperationalStateClusterPhaseListAttributeCallback(), + readOperationalStatePhaseListCommandParams + ); + result.put("readPhaseListAttribute", readOperationalStatePhaseListAttributeInteractionInfo); + Map readOperationalStateCurrentPhaseCommandParams = new LinkedHashMap(); + InteractionInfo readOperationalStateCurrentPhaseAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalStateCluster) cluster).readCurrentPhaseAttribute( + (ChipClusters.OperationalStateCluster.CurrentPhaseAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedOperationalStateClusterCurrentPhaseAttributeCallback(), + readOperationalStateCurrentPhaseCommandParams + ); + result.put("readCurrentPhaseAttribute", readOperationalStateCurrentPhaseAttributeInteractionInfo); + Map readOperationalStateCountdownTimeCommandParams = new LinkedHashMap(); + InteractionInfo readOperationalStateCountdownTimeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalStateCluster) cluster).readCountdownTimeAttribute( + (ChipClusters.OperationalStateCluster.CountdownTimeAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedOperationalStateClusterCountdownTimeAttributeCallback(), + readOperationalStateCountdownTimeCommandParams + ); + result.put("readCountdownTimeAttribute", readOperationalStateCountdownTimeAttributeInteractionInfo); + Map readOperationalStateOperationalStateListCommandParams = new LinkedHashMap(); + InteractionInfo readOperationalStateOperationalStateListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalStateCluster) cluster).readOperationalStateListAttribute( + (ChipClusters.OperationalStateCluster.OperationalStateListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedOperationalStateClusterOperationalStateListAttributeCallback(), + readOperationalStateOperationalStateListCommandParams + ); + result.put("readOperationalStateListAttribute", readOperationalStateOperationalStateListAttributeInteractionInfo); + Map readOperationalStateGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readOperationalStateGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalStateCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.OperationalStateCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedOperationalStateClusterGeneratedCommandListAttributeCallback(), + readOperationalStateGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readOperationalStateGeneratedCommandListAttributeInteractionInfo); + Map readOperationalStateAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readOperationalStateAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalStateCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.OperationalStateCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedOperationalStateClusterAcceptedCommandListAttributeCallback(), + readOperationalStateAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readOperationalStateAcceptedCommandListAttributeInteractionInfo); + Map readOperationalStateEventListCommandParams = new LinkedHashMap(); + InteractionInfo readOperationalStateEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalStateCluster) cluster).readEventListAttribute( + (ChipClusters.OperationalStateCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedOperationalStateClusterEventListAttributeCallback(), + readOperationalStateEventListCommandParams + ); + result.put("readEventListAttribute", readOperationalStateEventListAttributeInteractionInfo); + Map readOperationalStateAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readOperationalStateAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalStateCluster) cluster).readAttributeListAttribute( + (ChipClusters.OperationalStateCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedOperationalStateClusterAttributeListAttributeCallback(), + readOperationalStateAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readOperationalStateAttributeListAttributeInteractionInfo); + Map readOperationalStateFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readOperationalStateFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalStateCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readOperationalStateFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readOperationalStateFeatureMapAttributeInteractionInfo); + Map readOperationalStateClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readOperationalStateClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalStateCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOperationalStateClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readOperationalStateClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readHepaFilterMonitoringInteractionInfo() { Map result = new LinkedHashMap<>();Map readHepaFilterMonitoringConditionCommandParams = new LinkedHashMap(); InteractionInfo readHepaFilterMonitoringConditionAttributeInteractionInfo = new InteractionInfo( @@ -22362,6 +22476,7 @@ public Map> getReadAttributeMap() { put("refrigeratorAlarm", readRefrigeratorAlarmInteractionInfo()); put("airQuality", readAirQualityInteractionInfo()); put("smokeCoAlarm", readSmokeCoAlarmInteractionInfo()); + put("operationalState", readOperationalStateInteractionInfo()); 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 00415b04a17648..508627da1ea7f1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -822,6 +822,8 @@ public Map> getWriteAttributeMap() { ); writeSmokeCoAlarmInteractionInfo.put("writeSensitivityLevelAttribute", writeSmokeCoAlarmSensitivityLevelAttributeInteractionInfo); writeAttributeMap.put("smokeCoAlarm", writeSmokeCoAlarmInteractionInfo); + Map writeOperationalStateInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("operationalState", writeOperationalStateInteractionInfo); 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 5652312cda9d94..875b9a9d400ca3 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -13114,6 +13114,361 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::OperationalState::Id: { + using namespace app::Clusters::OperationalState; + 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(), + static_cast(entry_0.operationalStateID), newElement_0_operationalStateID); + jobject newElement_0_operationalStateLabel; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel, + newElement_0_operationalStateLabel)); + + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterOperationalStateStruct"); + return nullptr; + } + jmethodID operationalStateStructStructCtor_1 = + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + if (operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + 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(), + static_cast(cppValue.operationalStateID), value_operationalStateID); + jobject value_operationalStateLabel; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(cppValue.operationalStateLabel, value_operationalStateLabel)); + + jclass operationalStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterOperationalStateStruct"); + return nullptr; + } + jmethodID operationalStateStructStructCtor_0 = + env->GetMethodID(operationalStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + if (operationalStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct 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(), + static_cast(cppValue.errorStateID), value_errorStateID); + jobject value_errorStateLabel; + if (cppValue.errorStateLabel.IsNull()) + { + value_errorStateLabel = nullptr; + } + else + { + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateLabel.Value(), 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$OperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); + return nullptr; + } + jmethodID errorStateStructStructCtor_0 = env->GetMethodID( + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V"); + if (errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } + + value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, + value_errorStateLabel, value_errorStateDetails); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + 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/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index f9801c995bfa19..1874cb355bd6f2 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -2806,6 +2806,180 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::OperationalState::Id: { + using namespace app::Clusters::OperationalState; + 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(), + static_cast(cppValue.errorState.errorStateID), value_errorState_errorStateID); + jobject value_errorState_errorStateLabel; + if (cppValue.errorState.errorStateLabel.IsNull()) + { + value_errorState_errorStateLabel = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorState.errorStateLabel.Value(), + 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$OperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); + return nullptr; + } + jmethodID errorStateStructStructCtor_0 = env->GetMethodID( + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V"); + if (errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } + + value_errorState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, + value_errorState_errorStateLabel, value_errorState_errorStateDetails); + + jclass operationalErrorStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$OperationalStateClusterOperationalErrorEvent", + operationalErrorStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$OperationalStateClusterOperationalErrorEvent"); + return nullptr; + } + jmethodID operationalErrorStructCtor = + env->GetMethodID(operationalErrorStructClass, "", + "(Lchip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct;)V"); + if (operationalErrorStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$OperationalStateClusterOperationalErrorEvent 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(), + static_cast(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$OperationalStateClusterOperationCompletionEvent", + operationCompletionStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$OperationalStateClusterOperationCompletionEvent"); + 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$OperationalStateClusterOperationCompletionEvent 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 8f2d6b7ee78977..fa97d315711e4b 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -2809,6 +2809,114 @@ void CHIPIcdManagementClusterRegisterClientResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, ICDCounter); } +CHIPOperationalStateClusterOperationalCommandResponseCallback::CHIPOperationalStateClusterOperationalCommandResponseCallback( + 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"); + } +} + +CHIPOperationalStateClusterOperationalCommandResponseCallback::~CHIPOperationalStateClusterOperationalCommandResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::OperationalState::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$OperationalStateClusterErrorStateStruct;)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(), + static_cast(dataResponse.commandResponseState.errorStateID), CommandResponseState_errorStateID); + jobject CommandResponseState_errorStateLabel; + if (dataResponse.commandResponseState.errorStateLabel.IsNull()) + { + CommandResponseState_errorStateLabel = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + dataResponse.commandResponseState.errorStateLabel.Value(), 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$OperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); + return; + } + jmethodID errorStateStructStructCtor_0 = + env->GetMethodID(errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V"); + if (errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct 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 41fdc876e9a115..05c5d3a1039347 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -464,6 +464,21 @@ class CHIPIcdManagementClusterRegisterClientResponseCallback jobject javaCallbackRef; }; +class CHIPOperationalStateClusterOperationalCommandResponseCallback + : public Callback::Callback +{ +public: + CHIPOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback); + + ~CHIPOperationalStateClusterOperationalCommandResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::OperationalState::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 371ebe86c0d28d..3638025408f99e 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -21461,6 +21461,597 @@ void CHIPSmokeCoAlarmAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPOperationalStatePhaseListAttributeCallback::CHIPOperationalStatePhaseListAttributeCallback(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"); + } +} + +CHIPOperationalStatePhaseListAttributeCallback::~CHIPOperationalStatePhaseListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalStatePhaseListAttributeCallback::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); +} + +CHIPOperationalStateCurrentPhaseAttributeCallback::CHIPOperationalStateCurrentPhaseAttributeCallback(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"); + } +} + +CHIPOperationalStateCurrentPhaseAttributeCallback::~CHIPOperationalStateCurrentPhaseAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalStateCurrentPhaseAttributeCallback::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); +} + +CHIPOperationalStateCountdownTimeAttributeCallback::CHIPOperationalStateCountdownTimeAttributeCallback(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"); + } +} + +CHIPOperationalStateCountdownTimeAttributeCallback::~CHIPOperationalStateCountdownTimeAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalStateCountdownTimeAttributeCallback::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); +} + +CHIPOperationalStateOperationalStateListAttributeCallback::CHIPOperationalStateOperationalStateListAttributeCallback( + 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"); + } +} + +CHIPOperationalStateOperationalStateListAttributeCallback::~CHIPOperationalStateOperationalStateListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalStateOperationalStateListAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalState::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(), + static_cast(entry_0.operationalStateID), newElement_0_operationalStateID); + jobject newElement_0_operationalStateLabel; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel, newElement_0_operationalStateLabel)); + + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterOperationalStateStruct"); + return; + } + jmethodID operationalStateStructStructCtor_1 = + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + if (operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct 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); +} + +CHIPOperationalStateGeneratedCommandListAttributeCallback::CHIPOperationalStateGeneratedCommandListAttributeCallback( + 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"); + } +} + +CHIPOperationalStateGeneratedCommandListAttributeCallback::~CHIPOperationalStateGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalStateGeneratedCommandListAttributeCallback::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); +} + +CHIPOperationalStateAcceptedCommandListAttributeCallback::CHIPOperationalStateAcceptedCommandListAttributeCallback( + 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"); + } +} + +CHIPOperationalStateAcceptedCommandListAttributeCallback::~CHIPOperationalStateAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalStateAcceptedCommandListAttributeCallback::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); +} + +CHIPOperationalStateEventListAttributeCallback::CHIPOperationalStateEventListAttributeCallback(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"); + } +} + +CHIPOperationalStateEventListAttributeCallback::~CHIPOperationalStateEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalStateEventListAttributeCallback::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); +} + +CHIPOperationalStateAttributeListAttributeCallback::CHIPOperationalStateAttributeListAttributeCallback(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"); + } +} + +CHIPOperationalStateAttributeListAttributeCallback::~CHIPOperationalStateAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalStateAttributeListAttributeCallback::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 617763b5f12c31..080468b42da714 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -14992,6 +14992,249 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } + public static class OperationalStateCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 96L; + + public OperationalStateCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + 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 6a0bfaa39f51f0..a255ca0ad569b8 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -1140,6 +1140,58 @@ public String toString() { } } + public static class OperationalStateClusterOperationalErrorEvent { + public ChipStructs.OperationalStateClusterErrorStateStruct errorState; + + public OperationalStateClusterOperationalErrorEvent( + ChipStructs.OperationalStateClusterErrorStateStruct errorState) { + this.errorState = errorState; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("OperationalStateClusterOperationalErrorEvent {\n"); + output.append("\terrorState: "); + output.append(errorState); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class OperationalStateClusterOperationCompletionEvent { + public Integer completionErrorCode; + public @Nullable Optional totalOperationalTime; + public @Nullable Optional pausedTime; + + public OperationalStateClusterOperationCompletionEvent( + 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("OperationalStateClusterOperationCompletionEvent {\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 c9e41acc7b91d3..f0281a9c128344 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -162,6 +162,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 92L) { return "SmokeCoAlarm"; } + if (clusterId == 96L) { + return "OperationalState"; + } if (clusterId == 113L) { return "HepaFilterMonitoring"; } @@ -2300,6 +2303,45 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 96L) { + 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"; @@ -7066,6 +7108,15 @@ public static String eventIdToName(long clusterId, long eventId) { } return ""; } + if (clusterId == 96L) { + 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 0fea3804b54e07..d60eb2642c6983 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1541,6 +1541,63 @@ public String toString() { } } + public static class OperationalStateClusterErrorStateStruct { + public Integer errorStateID; + public @Nullable String errorStateLabel; + public Optional errorStateDetails; + + public OperationalStateClusterErrorStateStruct( + Integer errorStateID, + @Nullable String errorStateLabel, + Optional errorStateDetails) { + this.errorStateID = errorStateID; + this.errorStateLabel = errorStateLabel; + this.errorStateDetails = errorStateDetails; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("OperationalStateClusterErrorStateStruct {\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 OperationalStateClusterOperationalStateStruct { + public Integer operationalStateID; + public String operationalStateLabel; + + public OperationalStateClusterOperationalStateStruct( + Integer operationalStateID, String operationalStateLabel) { + this.operationalStateID = operationalStateID; + this.operationalStateLabel = operationalStateLabel; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("OperationalStateClusterOperationalStateStruct {\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 b0922f2bed16a3..e13d3d70917a5c 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -7801,6 +7801,202 @@ public void onError(Exception ex) { } } + public static class DelegatedOperationalStateClusterPhaseListAttributeCallback + implements ChipClusters.OperationalStateCluster.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 DelegatedOperationalStateClusterCurrentPhaseAttributeCallback + implements ChipClusters.OperationalStateCluster.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 DelegatedOperationalStateClusterCountdownTimeAttributeCallback + implements ChipClusters.OperationalStateCluster.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 DelegatedOperationalStateClusterOperationalStateListAttributeCallback + implements ChipClusters.OperationalStateCluster.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 DelegatedOperationalStateClusterGeneratedCommandListAttributeCallback + implements ChipClusters.OperationalStateCluster.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 DelegatedOperationalStateClusterAcceptedCommandListAttributeCallback + implements ChipClusters.OperationalStateCluster.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 DelegatedOperationalStateClusterEventListAttributeCallback + implements ChipClusters.OperationalStateCluster.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 DelegatedOperationalStateClusterAttributeListAttributeCallback + implements ChipClusters.OperationalStateCluster.AttributeListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedHepaFilterMonitoringClusterGeneratedCommandListAttributeCallback implements ChipClusters.HepaFilterMonitoringCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { @@ -24113,6 +24309,11 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.SmokeCoAlarmCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("smokeCoAlarm", smokeCoAlarmClusterInfo); + ClusterInfo operationalStateClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.OperationalStateCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("operationalState", operationalStateClusterInfo); ClusterInfo hepaFilterMonitoringClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.HepaFilterMonitoringCluster(ptr, endpointId), @@ -24650,6 +24851,7 @@ public void combineCommand( destination.get("refrigeratorAlarm").combineCommands(source.get("refrigeratorAlarm")); destination.get("airQuality").combineCommands(source.get("airQuality")); destination.get("smokeCoAlarm").combineCommands(source.get("smokeCoAlarm")); + destination.get("operationalState").combineCommands(source.get("operationalState")); destination.get("hepaFilterMonitoring").combineCommands(source.get("hepaFilterMonitoring")); destination .get("activatedCarbonFilterMonitoring") @@ -27055,6 +27257,8 @@ public Map> getCommandMap() { smokeCoAlarmClusterInteractionInfoMap.put( "selfTestRequest", smokeCoAlarmselfTestRequestInteractionInfo); commandMap.put("smokeCoAlarm", smokeCoAlarmClusterInteractionInfoMap); + Map operationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("operationalState", operationalStateClusterInteractionInfoMap); Map hepaFilterMonitoringClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("hepaFilterMonitoring", hepaFilterMonitoringClusterInteractionInfoMap); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 6f70b15dc8886d..245a04822f7c69 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -4690,6 +4690,110 @@ class ChipClusters: }, }, } + _OPERATIONAL_STATE_CLUSTER_INFO = { + "clusterName": "OperationalState", + "clusterId": 0x00000060, + "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, @@ -14953,6 +15057,7 @@ class ChipClusters: 0x00000057: _REFRIGERATOR_ALARM_CLUSTER_INFO, 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, 0x0000005C: _SMOKE_CO_ALARM_CLUSTER_INFO, + 0x00000060: _OPERATIONAL_STATE_CLUSTER_INFO, 0x00000071: _HEPA_FILTER_MONITORING_CLUSTER_INFO, 0x00000072: _ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_INFO, 0x00000073: _CERAMIC_FILTER_MONITORING_CLUSTER_INFO, @@ -15080,6 +15185,7 @@ class ChipClusters: "RefrigeratorAlarm": _REFRIGERATOR_ALARM_CLUSTER_INFO, "AirQuality": _AIR_QUALITY_CLUSTER_INFO, "SmokeCoAlarm": _SMOKE_CO_ALARM_CLUSTER_INFO, + "OperationalState": _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 48d94a7c929106..fa9072aad0e8f6 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -16393,6 +16393,399 @@ def descriptor(cls) -> ClusterObjectDescriptor: ]) +@dataclass +class OperationalState(Cluster): + id: typing.ClassVar[int] = 0x0060 + + @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[OperationalState.Structs.OperationalStateStruct]), + ClusterObjectFieldDescriptor(Label="operationalState", Tag=0x00000004, Type=OperationalState.Structs.OperationalStateStruct), + ClusterObjectFieldDescriptor(Label="operationalError", Tag=0x00000005, Type=OperationalState.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[OperationalState.Structs.OperationalStateStruct]' = None + operationalState: 'OperationalState.Structs.OperationalStateStruct' = None + operationalError: 'OperationalState.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): + kNoError = 0x00 + kUnableToStartOrResume = 0x01 + kUnableToCompleteOperation = 0x02 + kCommandInvalidInState = 0x03 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 4, + + class OperationalStateEnum(MatterIntEnum): + kStopped = 0x00 + kRunning = 0x01 + kPaused = 0x02 + kError = 0x03 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 4, + + class Structs: + @dataclass + class ErrorStateStruct(ClusterObject): + @ChipUtility.classproperty + 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="errorStateDetails", Tag=2, Type=typing.Optional[str]), + ]) + + errorStateID: 'OperationalState.Enums.ErrorStateEnum' = 0 + errorStateLabel: 'typing.Union[Nullable, str]' = NullValue + errorStateDetails: 'typing.Optional[str]' = None + + @dataclass + class OperationalStateStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="operationalStateID", Tag=0, Type=OperationalState.Enums.OperationalStateEnum), + ClusterObjectFieldDescriptor(Label="operationalStateLabel", Tag=1, Type=str), + ]) + + operationalStateID: 'OperationalState.Enums.OperationalStateEnum' = 0 + operationalStateLabel: 'str' = "" + + class Commands: + @dataclass + class Pause(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0060 + 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] = 0x0060 + 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] = 0x0060 + 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] = 0x0060 + 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] = 0x0060 + 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=OperationalState.Structs.ErrorStateStruct), + ]) + + commandResponseState: 'OperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: OperationalState.Structs.ErrorStateStruct()) + + class Attributes: + @dataclass + class PhaseList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0060 + + @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 0x0060 + + @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 0x0060 + + @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 0x0060 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[OperationalState.Structs.OperationalStateStruct]) + + value: 'typing.List[OperationalState.Structs.OperationalStateStruct]' = field(default_factory=lambda: []) + + @dataclass + class OperationalState(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0060 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=OperationalState.Structs.OperationalStateStruct) + + value: 'OperationalState.Structs.OperationalStateStruct' = field(default_factory=lambda: OperationalState.Structs.OperationalStateStruct()) + + @dataclass + class OperationalError(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0060 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=OperationalState.Structs.ErrorStateStruct) + + value: 'OperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: OperationalState.Structs.ErrorStateStruct()) + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0060 + + @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 0x0060 + + @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 0x0060 + + @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 0x0060 + + @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 0x0060 + + @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 0x0060 + + @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 0x0060 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="errorState", Tag=0, Type=OperationalState.Structs.ErrorStateStruct), + ]) + + errorState: 'OperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: OperationalState.Structs.ErrorStateStruct()) + + @dataclass + class OperationCompletion(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0060 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="completionErrorCode", Tag=0, Type=OperationalState.Enums.ErrorStateEnum), + 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 + totalOperationalTime: 'typing.Union[None, Nullable, uint]' = None + pausedTime: 'typing.Union[None, Nullable, uint]' = None + + @dataclass class HepaFilterMonitoring(Cluster): id: typing.ClassVar[int] = 0x0071 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 214ec3ea26c7c4..5dda77c184e37d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -1976,6 +1976,51 @@ static BOOL AttributeIsSpecifiedInSmokeCOAlarmCluster(AttributeId aAttributeId) } } } +static BOOL AttributeIsSpecifiedInOperationalStateCluster(AttributeId aAttributeId) +{ + using namespace Clusters::OperationalState; + 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; @@ -7002,6 +7047,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::SmokeCoAlarm::Id: { return AttributeIsSpecifiedInSmokeCOAlarmCluster(aAttributeId); } + case Clusters::OperationalState::Id: { + return AttributeIsSpecifiedInOperationalStateCluster(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 af82867b120000..5ca0aa2d5b0fb1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -10070,6 +10070,278 @@ static id _Nullable DecodeAttributeValueForSmokeCOAlarmCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForOperationalStateCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OperationalState; + 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 = [[NSString alloc] initWithBytes:entry_1.data() + length:entry_1.size() + encoding:NSUTF8StringEncoding]; + [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(); + MTROperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTROperationalStateClusterOperationalStateStruct new]; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.operationalStateID)]; + newElement_0.operationalStateLabel = [[NSString alloc] initWithBytes:entry_0.operationalStateLabel.data() + length:entry_0.operationalStateLabel.size() + encoding:NSUTF8StringEncoding]; + [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; + } + MTROperationalStateClusterOperationalStateStruct * _Nonnull value; + value = [MTROperationalStateClusterOperationalStateStruct new]; + value.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.operationalStateID)]; + value.operationalStateLabel = [[NSString alloc] initWithBytes:cppValue.operationalStateLabel.data() + length:cppValue.operationalStateLabel.size() + encoding:NSUTF8StringEncoding]; + 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; + } + MTROperationalStateClusterErrorStateStruct * _Nonnull value; + value = [MTROperationalStateClusterErrorStateStruct new]; + value.errorStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.errorStateID)]; + if (cppValue.errorStateLabel.IsNull()) { + value.errorStateLabel = nil; + } else { + value.errorStateLabel = [[NSString alloc] initWithBytes:cppValue.errorStateLabel.Value().data() + length:cppValue.errorStateLabel.Value().size() + encoding:NSUTF8StringEncoding]; + } + if (cppValue.errorStateDetails.HasValue()) { + value.errorStateDetails = [[NSString alloc] initWithBytes:cppValue.errorStateDetails.Value().data() + length:cppValue.errorStateDetails.Value().size() + encoding:NSUTF8StringEncoding]; + } 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 DecodeAttributeValueForHEPAFilterMonitoringCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { @@ -33106,6 +33378,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::SmokeCoAlarm::Id: { return DecodeAttributeValueForSmokeCOAlarmCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::OperationalState::Id: { + return DecodeAttributeValueForOperationalStateCluster(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 30c553c5d53bcd..4df91700c17309 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -8550,6 +8550,212 @@ MTR_NEWLY_AVAILABLE @end +/** + * Cluster Operational State + * + * This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state + * machine is a part of the operation. + */ +MTR_NEWLY_AVAILABLE +@interface MTRBaseClusterOperationalState : 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:(MTROperationalStateClusterPauseParams * _Nullable)params + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)pauseWithCompletion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _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:(MTROperationalStateClusterStopParams * _Nullable)params + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)stopWithCompletion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _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:(MTROperationalStateClusterStartParams * _Nullable)params + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)startWithCompletion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _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:(MTROperationalStateClusterResumeParams * _Nullable)params + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)resumeWithCompletion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _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 (^)(MTROperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeOperationalStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTROperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeOperationalStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(MTROperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeOperationalErrorWithCompletion:(void (^)(MTROperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeOperationalErrorWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTROperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeOperationalErrorWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(MTROperationalStateClusterErrorStateStruct * _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 * @@ -31390,6 +31596,20 @@ typedef NS_OPTIONS(uint32_t, MTRSmokeCOAlarmFeature) { MTRSmokeCOAlarmFeatureCOAlarm MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTROperationalStateErrorState) { + MTROperationalStateErrorStateNoError MTR_NEWLY_AVAILABLE = 0x00, + MTROperationalStateErrorStateUnableToStartOrResume MTR_NEWLY_AVAILABLE = 0x01, + MTROperationalStateErrorStateUnableToCompleteOperation MTR_NEWLY_AVAILABLE = 0x02, + MTROperationalStateErrorStateCommandInvalidInState MTR_NEWLY_AVAILABLE = 0x03, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTROperationalState) { + MTROperationalStateStopped MTR_NEWLY_AVAILABLE = 0x00, + MTROperationalStateRunning MTR_NEWLY_AVAILABLE = 0x01, + MTROperationalStatePaused MTR_NEWLY_AVAILABLE = 0x02, + MTROperationalStateError MTR_NEWLY_AVAILABLE = 0x03, +} 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 86ab427ba3c300..d112ab6d2176cf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -50136,6 +50136,711 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterOperationalState + +- (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 (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self pauseWithParams:nil completion:completion]; +} +- (void)pauseWithParams:(MTROperationalStateClusterPauseParams * _Nullable)params + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTROperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + OperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + OperationalState::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 (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self stopWithParams:nil completion:completion]; +} +- (void)stopWithParams:(MTROperationalStateClusterStopParams * _Nullable)params + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTROperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + OperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + OperationalState::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 (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self startWithParams:nil completion:completion]; +} +- (void)startWithParams:(MTROperationalStateClusterStartParams * _Nullable)params + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTROperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + OperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + OperationalState::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 (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self resumeWithParams:nil completion:completion]; +} +- (void)resumeWithParams:(MTROperationalStateClusterResumeParams * _Nullable)params + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTROperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + OperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + OperationalState::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 = OperationalState::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 = OperationalState::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 MTROperationalStatePhaseListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(OperationalStatePhaseListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalState::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 = OperationalState::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 = OperationalState::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 = OperationalState::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 = OperationalState::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 = OperationalState::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 = OperationalState::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 = OperationalState::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 = OperationalState::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 MTROperationalStateOperationalStateListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(OperationalStateOperationalStateListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalState::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 (^)(MTROperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = OperationalState::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 (^)(MTROperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler +{ + using TypeInfo = OperationalState::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 (^)(MTROperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion +{ + auto * bridge = new MTROperationalStateOperationalStateStructAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(OperationalStateOperationalStateStructAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalState::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 (^)(MTROperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = OperationalState::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 (^)(MTROperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler +{ + using TypeInfo = OperationalState::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 (^)(MTROperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion +{ + auto * bridge = new MTROperationalStateOperationalErrorStructAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(OperationalStateOperationalErrorStructAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalState::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 = OperationalState::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 = OperationalState::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 MTROperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(OperationalStateGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalState::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 = OperationalState::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 = OperationalState::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 MTROperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(OperationalStateAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalState::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 = OperationalState::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 = OperationalState::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 MTROperationalStateEventListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(OperationalStateEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalState::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 = OperationalState::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 = OperationalState::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 MTROperationalStateAttributeListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(OperationalStateAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalState::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 = OperationalState::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 = OperationalState::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 = OperationalState::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 = OperationalState::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 = OperationalState::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 = OperationalState::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 1bfeee0e71e570..a5397af42c3e46 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -220,6 +220,11 @@ @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end +@interface MTRBaseClusterOperationalState () +@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 7affdabb92dffc..242230baac62b3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -85,6 +85,8 @@ typedef void (*GroupKeyManagementClusterKeySetReadResponseCallbackType)( void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType &); 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 (*DoorLockClusterGetWeekDayScheduleResponseCallbackType)( void *, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType &); typedef void (*DoorLockClusterGetYearDayScheduleResponseCallbackType)( @@ -403,6 +405,14 @@ typedef void (*NullableSmokeCOAlarmClusterMuteStateEnumAttributeCallback)( typedef void (*SmokeCOAlarmClusterSensitivityEnumAttributeCallback)(void *, chip::app::Clusters::SmokeCoAlarm::SensitivityEnum); typedef void (*NullableSmokeCOAlarmClusterSensitivityEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); +typedef void (*OperationalStateClusterErrorStateEnumAttributeCallback)(void *, + chip::app::Clusters::OperationalState::ErrorStateEnum); +typedef void (*NullableOperationalStateClusterErrorStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*OperationalStateClusterOperationalStateEnumAttributeCallback)( + void *, chip::app::Clusters::OperationalState::OperationalStateEnum); +typedef void (*NullableOperationalStateClusterOperationalStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*HEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallback)( void *, chip::app::Clusters::HepaFilterMonitoring::ChangeIndicationEnum); typedef void (*NullableHEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallback)( @@ -1611,6 +1621,24 @@ typedef void (*SmokeCOAlarmEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*SmokeCOAlarmAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*OperationalStatePhaseListListAttributeCallback)( + void * context, const chip::app::DataModel::Nullable> & data); +typedef void (*OperationalStateOperationalStateListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType> & data); +typedef void (*OperationalStateOperationalStateStructAttributeCallback)( + void *, const chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType &); +typedef void (*OperationalStateOperationalErrorStructAttributeCallback)( + void *, const chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType &); +typedef void (*OperationalStateGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*OperationalStateAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*OperationalStateEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*OperationalStateAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HEPAFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HEPAFilterMonitoringAcceptedCommandListListAttributeCallback)( @@ -10032,6 +10060,275 @@ class MTRSmokeCOAlarmAttributeListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTROperationalStatePhaseListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTROperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTROperationalStatePhaseListListAttributeCallbackBridge(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 MTROperationalStatePhaseListListAttributeCallbackSubscriptionBridge + : public MTROperationalStatePhaseListListAttributeCallbackBridge +{ +public: + MTROperationalStatePhaseListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTROperationalStatePhaseListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTROperationalStatePhaseListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTROperationalStatePhaseListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTROperationalStateOperationalStateListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTROperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTROperationalStateOperationalStateListListAttributeCallbackBridge(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::OperationalState::Structs::OperationalStateStruct::DecodableType> & value); +}; + +class MTROperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge + : public MTROperationalStateOperationalStateListListAttributeCallbackBridge +{ +public: + MTROperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTROperationalStateOperationalStateListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTROperationalStateOperationalStateListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTROperationalStateOperationalStateListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTROperationalStateOperationalStateStructAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTROperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTROperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, + const chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType & value); +}; + +class MTROperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge + : public MTROperationalStateOperationalStateStructAttributeCallbackBridge +{ +public: + MTROperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTROperationalStateOperationalStateStructAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTROperationalStateOperationalStateStructAttributeCallbackBridge::KeepAliveOnCallback; + using MTROperationalStateOperationalStateStructAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTROperationalStateOperationalErrorStructAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTROperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTROperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, + const chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType & value); +}; + +class MTROperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge + : public MTROperationalStateOperationalErrorStructAttributeCallbackBridge +{ +public: + MTROperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTROperationalStateOperationalErrorStructAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTROperationalStateOperationalErrorStructAttributeCallbackBridge::KeepAliveOnCallback; + using MTROperationalStateOperationalErrorStructAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTROperationalStateGeneratedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTROperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTROperationalStateGeneratedCommandListListAttributeCallbackBridge(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 MTROperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge + : public MTROperationalStateGeneratedCommandListListAttributeCallbackBridge +{ +public: + MTROperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTROperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTROperationalStateGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTROperationalStateGeneratedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTROperationalStateAcceptedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTROperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTROperationalStateAcceptedCommandListListAttributeCallbackBridge(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 MTROperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge + : public MTROperationalStateAcceptedCommandListListAttributeCallbackBridge +{ +public: + MTROperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTROperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTROperationalStateAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTROperationalStateAcceptedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTROperationalStateEventListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTROperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTROperationalStateEventListListAttributeCallbackBridge(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 MTROperationalStateEventListListAttributeCallbackSubscriptionBridge + : public MTROperationalStateEventListListAttributeCallbackBridge +{ +public: + MTROperationalStateEventListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTROperationalStateEventListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTROperationalStateEventListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTROperationalStateEventListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTROperationalStateAttributeListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTROperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTROperationalStateAttributeListListAttributeCallbackBridge(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 MTROperationalStateAttributeListListAttributeCallbackSubscriptionBridge + : public MTROperationalStateAttributeListListAttributeCallbackBridge +{ +public: + MTROperationalStateAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTROperationalStateAttributeListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTROperationalStateAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTROperationalStateAttributeListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRHEPAFilterMonitoringGeneratedCommandListListAttributeCallbackBridge : public MTRCallbackBridge { @@ -22198,6 +22495,22 @@ class MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data); }; +class MTROperationalStateClusterOperationalCommandResponseCallbackBridge + : public MTRCallbackBridge +{ +public: + MTROperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTROperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void + OnSuccessFn(void * context, + const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & data); +}; + class MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge : public MTRCallbackBridge { @@ -27637,6 +27950,142 @@ class MTRNullableSmokeCOAlarmClusterSensitivityEnumAttributeCallbackSubscription MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTROperationalStateClusterErrorStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTROperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTROperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::OperationalState::ErrorStateEnum value); +}; + +class MTROperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge + : public MTROperationalStateClusterErrorStateEnumAttributeCallbackBridge +{ +public: + MTROperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTROperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTROperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTROperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableOperationalStateClusterErrorStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRNullableOperationalStateClusterErrorStateEnumAttributeCallbackBridge(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 MTRNullableOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableOperationalStateClusterErrorStateEnumAttributeCallbackBridge +{ +public: + MTRNullableOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTROperationalStateClusterOperationalStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTROperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTROperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::OperationalState::OperationalStateEnum value); +}; + +class MTROperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge + : public MTROperationalStateClusterOperationalStateEnumAttributeCallbackBridge +{ +public: + MTROperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTROperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTROperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTROperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(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 MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackBridge +{ +public: + MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::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 c7eb03493f64d9..f19e6f96def92f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -8928,6 +8928,308 @@ } } +void MTROperationalStatePhaseListListAttributeCallbackBridge::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 = [[NSString alloc] initWithBytes:entry_1.data() length:entry_1.size() encoding:NSUTF8StringEncoding]; + [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 MTROperationalStatePhaseListListAttributeCallbackSubscriptionBridge::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 MTROperationalStateOperationalStateListListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalState::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(); + MTROperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTROperationalStateClusterOperationalStateStruct new]; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.operationalStateID)]; + newElement_0.operationalStateLabel = [[NSString alloc] initWithBytes:entry_0.operationalStateLabel.data() + length:entry_0.operationalStateLabel.size() + encoding:NSUTF8StringEncoding]; + [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 MTROperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge::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 MTROperationalStateOperationalStateStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType & value) +{ + MTROperationalStateClusterOperationalStateStruct * _Nonnull objCValue; + objCValue = [MTROperationalStateClusterOperationalStateStruct new]; + objCValue.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.operationalStateID)]; + objCValue.operationalStateLabel = [[NSString alloc] initWithBytes:value.operationalStateLabel.data() + length:value.operationalStateLabel.size() + encoding:NSUTF8StringEncoding]; + DispatchSuccess(context, objCValue); +}; + +void MTROperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge::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 MTROperationalStateOperationalErrorStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType & value) +{ + MTROperationalStateClusterErrorStateStruct * _Nonnull objCValue; + objCValue = [MTROperationalStateClusterErrorStateStruct new]; + objCValue.errorStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.errorStateID)]; + if (value.errorStateLabel.IsNull()) { + objCValue.errorStateLabel = nil; + } else { + objCValue.errorStateLabel = [[NSString alloc] initWithBytes:value.errorStateLabel.Value().data() + length:value.errorStateLabel.Value().size() + encoding:NSUTF8StringEncoding]; + } + if (value.errorStateDetails.HasValue()) { + objCValue.errorStateDetails = [[NSString alloc] initWithBytes:value.errorStateDetails.Value().data() + length:value.errorStateDetails.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + objCValue.errorStateDetails = nil; + } + DispatchSuccess(context, objCValue); +}; + +void MTROperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge::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 MTROperationalStateGeneratedCommandListListAttributeCallbackBridge::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 MTROperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge::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 MTROperationalStateAcceptedCommandListListAttributeCallbackBridge::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 MTROperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge::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 MTROperationalStateEventListListAttributeCallbackBridge::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 MTROperationalStateEventListListAttributeCallbackSubscriptionBridge::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 MTROperationalStateAttributeListListAttributeCallbackBridge::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 MTROperationalStateAttributeListListAttributeCallbackSubscriptionBridge::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) { @@ -22594,6 +22896,18 @@ DispatchSuccess(context, response); }; +void MTROperationalStateClusterOperationalCommandResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & data) +{ + auto * response = [MTROperationalStateClusterOperationalCommandResponseParams 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) { @@ -26565,6 +26879,106 @@ } } +void MTROperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::OperationalState::ErrorStateEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTROperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::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 MTRNullableOperationalStateClusterErrorStateEnumAttributeCallbackBridge::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 MTRNullableOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::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 MTROperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::OperationalState::OperationalStateEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTROperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge::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 MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::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 MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge::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 6a111ed79f2972..60ef563a8ed5e4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -280,6 +280,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeRefrigeratorAlarmID MTR_NEWLY_AVAILABLE = 0x00000057, MTRClusterIDTypeAirQualityID MTR_NEWLY_AVAILABLE = 0x0000005B, MTRClusterIDTypeSmokeCOAlarmID MTR_NEWLY_AVAILABLE = 0x0000005C, + MTRClusterIDTypeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000060, MTRClusterIDTypeHEPAFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000071, MTRClusterIDTypeActivatedCarbonFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000072, MTRClusterIDTypeCeramicFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000073, @@ -3841,6 +3842,26 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterSmokeCOAlarmAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster OperationalState attributes + MTRAttributeIDTypeClusterOperationalStateAttributePhaseListID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterOperationalStateAttributeCurrentPhaseID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterOperationalStateAttributeCountdownTimeID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterOperationalStateAttributeOperationalStateListID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterOperationalStateAttributeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterOperationalStateAttributeOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterOperationalStateAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterOperationalStateAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterOperationalStateAttributeEventListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterOperationalStateAttributeAttributeListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterOperationalStateAttributeFeatureMapID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster HEPAFilterMonitoring attributes MTRAttributeIDTypeClusterHEPAFilterMonitoringAttributeConditionID MTR_NEWLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterHEPAFilterMonitoringAttributeDegradationDirectionID MTR_NEWLY_AVAILABLE = 0x00000001, @@ -10173,6 +10194,13 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { // Cluster SmokeCOAlarm commands MTRCommandIDTypeClusterSmokeCOAlarmCommandSelfTestRequestID MTR_NEWLY_AVAILABLE = 0x00000000, + // Cluster OperationalState commands + MTRCommandIDTypeClusterOperationalStateCommandPauseID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterOperationalStateCommandStopID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterOperationalStateCommandStartID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterOperationalStateCommandResumeID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterOperationalStateCommandOperationalCommandResponseID MTR_NEWLY_AVAILABLE = 0x00000004, + // Cluster HEPAFilterMonitoring commands MTRCommandIDTypeClusterHEPAFilterMonitoringCommandResetConditionID MTR_NEWLY_AVAILABLE = 0x00000000, @@ -11343,6 +11371,10 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterSmokeCOAlarmEventInterconnectCOAlarmID MTR_NEWLY_AVAILABLE = 0x00000009, MTREventIDTypeClusterSmokeCOAlarmEventAllClearID MTR_NEWLY_AVAILABLE = 0x0000000A, + // Cluster OperationalState events + MTREventIDTypeClusterOperationalStateEventOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterOperationalStateEventOperationCompletionID 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 2bcd2f9948ffff..f5a0b6a0ee34e4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -2985,6 +2985,84 @@ MTR_NEWLY_AVAILABLE @end +/** + * Cluster Operational State + * This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state + * machine is a part of the operation. + */ +MTR_NEWLY_AVAILABLE +@interface MTRClusterOperationalState : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +- (void)pauseWithParams:(MTROperationalStateClusterPauseParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)pauseWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)stopWithParams:(MTROperationalStateClusterStopParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)stopWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)startWithParams:(MTROperationalStateClusterStartParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)startWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)resumeWithParams:(MTROperationalStateClusterResumeParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)resumeWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _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 961d9946fb1f46..c20c8018ca737e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -13606,6 +13606,423 @@ - (void)writeAttributeSensitivityLevelWithValue:(NSDictionary *) @end +@implementation MTRClusterOperationalState + +- (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 (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self pauseWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)pauseWithParams:(MTROperationalStateClusterPauseParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterOperationalStateCommandPauseID]; + // 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 MTROperationalStateClusterOperationalCommandResponseCallbackBridge( + 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, + OperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + OperationalState::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 (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self stopWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)stopWithParams:(MTROperationalStateClusterStopParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterOperationalStateCommandStopID]; + // 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 MTROperationalStateClusterOperationalCommandResponseCallbackBridge( + 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, + OperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + OperationalState::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 (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self startWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)startWithParams:(MTROperationalStateClusterStartParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterOperationalStateCommandStartID]; + // 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 MTROperationalStateClusterOperationalCommandResponseCallbackBridge( + 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, + OperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + OperationalState::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 (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self resumeWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)resumeWithParams:(MTROperationalStateClusterResumeParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterOperationalStateCommandResumeID]; + // 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 MTROperationalStateClusterOperationalCommandResponseCallbackBridge( + 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, + OperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + OperationalState::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:@(MTRClusterIDTypeOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterOperationalStateAttributePhaseListID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentPhaseWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterOperationalStateAttributeCurrentPhaseID) + params:params]; +} + +- (NSDictionary *)readAttributeCountdownTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterOperationalStateAttributeCountdownTimeID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalStateListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterOperationalStateAttributeOperationalStateListID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterOperationalStateAttributeOperationalStateID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalErrorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterOperationalStateAttributeOperationalErrorID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterOperationalStateAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterOperationalStateAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterOperationalStateAttributeEventListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterOperationalStateAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterOperationalStateAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterOperationalStateAttributeClusterRevisionID) + 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 b43cd3b7583839..d6a12b25f05ca7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -221,6 +221,11 @@ @property (nonatomic, readonly) MTRDevice * device; @end +@interface MTRClusterOperationalState () +@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 b0f528787d97c0..23a469fca59c39 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -4169,6 +4169,137 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_NEWLY_AVAILABLE +@interface MTROperationalStateClusterPauseParams : 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 MTROperationalStateClusterStopParams : 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 MTROperationalStateClusterStartParams : 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 MTROperationalStateClusterResumeParams : 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 MTROperationalStateClusterOperationalCommandResponseParams : NSObject + +@property (nonatomic, copy) MTROperationalStateClusterErrorStateStruct * _Nonnull commandResponseState MTR_NEWLY_AVAILABLE; + +/** + * Initialize an MTROperationalStateClusterOperationalCommandResponseParams 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 67732009ad5c4c..3d3d8ff2592c44 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -6543,6 +6543,211 @@ - (NSString *)description return descriptionString; } +@end +@implementation MTROperationalStateClusterPauseParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTROperationalStateClusterPauseParams 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 MTROperationalStateClusterStopParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTROperationalStateClusterStopParams 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 MTROperationalStateClusterStartParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTROperationalStateClusterStartParams 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 MTROperationalStateClusterResumeParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTROperationalStateClusterResumeParams 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 MTROperationalStateClusterOperationalCommandResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _commandResponseState = [MTROperationalStateClusterErrorStateStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTROperationalStateClusterOperationalCommandResponseParams 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::OperationalState::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 MTROperationalStateClusterOperationalCommandResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType &)decodableStruct +{ + { + self.commandResponseState = [MTROperationalStateClusterErrorStateStruct new]; + self.commandResponseState.errorStateID = + [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.commandResponseState.errorStateID)]; + if (decodableStruct.commandResponseState.errorStateLabel.IsNull()) { + self.commandResponseState.errorStateLabel = nil; + } else { + self.commandResponseState.errorStateLabel = + [[NSString alloc] initWithBytes:decodableStruct.commandResponseState.errorStateLabel.Value().data() + length:decodableStruct.commandResponseState.errorStateLabel.Value().size() + encoding:NSUTF8StringEncoding]; + } + if (decodableStruct.commandResponseState.errorStateDetails.HasValue()) { + self.commandResponseState.errorStateDetails = + [[NSString alloc] initWithBytes:decodableStruct.commandResponseState.errorStateDetails.Value().data() + length:decodableStruct.commandResponseState.errorStateDetails.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.commandResponseState.errorStateDetails = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRHEPAFilterMonitoringClusterResetConditionParams - (instancetype)init diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 1de843868eb61f..28f95b18ae822e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -217,6 +217,13 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTROperationalStateClusterOperationalCommandResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OperationalState::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 d0767405aa8352..23417d19afd3b7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1755,6 +1755,93 @@ static id _Nullable DecodeEventPayloadForSmokeCOAlarmCluster(EventId aEventId, T *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForOperationalStateCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OperationalState; + 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 = [MTROperationalStateClusterOperationalErrorEvent new]; + + do { + MTROperationalStateClusterErrorStateStruct * _Nonnull memberValue; + memberValue = [MTROperationalStateClusterErrorStateStruct new]; + memberValue.errorStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.errorState.errorStateID)]; + if (cppValue.errorState.errorStateLabel.IsNull()) { + memberValue.errorStateLabel = nil; + } else { + memberValue.errorStateLabel = [[NSString alloc] initWithBytes:cppValue.errorState.errorStateLabel.Value().data() + length:cppValue.errorState.errorStateLabel.Value().size() + encoding:NSUTF8StringEncoding]; + } + if (cppValue.errorState.errorStateDetails.HasValue()) { + memberValue.errorStateDetails = [[NSString alloc] initWithBytes:cppValue.errorState.errorStateDetails.Value().data() + length:cppValue.errorState.errorStateDetails.Value().size() + encoding:NSUTF8StringEncoding]; + } 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:chip::to_underlying(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 DecodeEventPayloadForHEPAFilterMonitoringCluster( EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { @@ -3419,6 +3506,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::SmokeCoAlarm::Id: { return DecodeEventPayloadForSmokeCOAlarmCluster(aPath.mEventId, aReader, aError); } + case Clusters::OperationalState::Id: { + return DecodeEventPayloadForOperationalStateCluster(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 a61ee5b0006168..cc74fc4ae256a8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -741,6 +741,31 @@ MTR_NEWLY_AVAILABLE @interface MTRSmokeCOAlarmClusterAllClearEvent : NSObject @end +MTR_NEWLY_AVAILABLE +@interface MTROperationalStateClusterErrorStateStruct : 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 MTROperationalStateClusterOperationalStateStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull operationalStateID MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull operationalStateLabel MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTROperationalStateClusterOperationalErrorEvent : NSObject +@property (nonatomic, copy) MTROperationalStateClusterErrorStateStruct * _Nonnull errorState MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTROperationalStateClusterOperationCompletionEvent : 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 082e2ea0c1f1c1..ab2063b6160e59 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -2991,6 +2991,134 @@ - (NSString *)description @end +@implementation MTROperationalStateClusterErrorStateStruct +- (instancetype)init +{ + if (self = [super init]) { + + _errorStateID = @(0); + + _errorStateLabel = nil; + + _errorStateDetails = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTROperationalStateClusterErrorStateStruct 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 MTROperationalStateClusterOperationalStateStruct +- (instancetype)init +{ + if (self = [super init]) { + + _operationalStateID = @(0); + + _operationalStateLabel = @""; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTROperationalStateClusterOperationalStateStruct 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 MTROperationalStateClusterOperationalErrorEvent +- (instancetype)init +{ + if (self = [super init]) { + + _errorState = [MTROperationalStateClusterErrorStateStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTROperationalStateClusterOperationalErrorEvent alloc] init]; + + other.errorState = self.errorState; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: errorState:%@; >", NSStringFromClass([self class]), _errorState]; + return descriptionString; +} + +@end + +@implementation MTROperationalStateClusterOperationCompletionEvent +- (instancetype)init +{ + if (self = [super init]) { + + _completionErrorCode = @(0); + + _totalOperationalTime = nil; + + _pausedTime = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTROperationalStateClusterOperationCompletionEvent 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 1b4e9e6228c3fa..b403e7ba649597 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 @@ -8195,6 +8195,180 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace SmokeCoAlarm +namespace OperationalState { +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::OperationalState::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::OperationalState::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::OperationalState::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::OperationalState::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::OperationalState::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::OperationalState::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::OperationalState::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::OperationalState::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::OperationalState::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::OperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace OperationalState + 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 2ea2774cfa89c9..94bf7b15cced7a 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 @@ -1562,6 +1562,36 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace SmokeCoAlarm +namespace OperationalState { +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 OperationalState + 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 8764963d606a4b..abe72492d66c6b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -401,6 +401,14 @@ void emberAfAirQualityClusterInitCallback(chip::EndpointId endpoint); */ void emberAfSmokeCoAlarmClusterInitCallback(chip::EndpointId endpoint); +/** @brief Operational State Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpoint); + /** @brief HEPA Filter Monitoring Cluster Init * * Cluster Init @@ -4574,6 +4582,84 @@ void emberAfSmokeCoAlarmClusterServerTickCallback(chip::EndpointId endpoint); */ void emberAfSmokeCoAlarmClusterClientTickCallback(chip::EndpointId endpoint); +// +// Operational State Cluster +// + +/** @brief Operational State Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfOperationalStateClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Operational State Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterOperationalStateClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief Operational State Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfOperationalStateClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Operational State Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterOperationalStateClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief 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 +MatterOperationalStateClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief 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 +MatterOperationalStateClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Operational State Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfOperationalStateClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Operational State Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); + // // HEPA Filter Monitoring Cluster // @@ -11107,6 +11193,30 @@ bool emberAfRefrigeratorAlarmClusterResetCallback( bool emberAfSmokeCoAlarmClusterSelfTestRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::SmokeCoAlarm::Commands::SelfTestRequest::DecodableType & commandData); +/** + * @brief Operational State Cluster Pause Command callback (from client) + */ +bool emberAfOperationalStateClusterPauseCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::OperationalState::Commands::Pause::DecodableType & commandData); +/** + * @brief Operational State Cluster Stop Command callback (from client) + */ +bool emberAfOperationalStateClusterStopCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::OperationalState::Commands::Stop::DecodableType & commandData); +/** + * @brief Operational State Cluster Start Command callback (from client) + */ +bool emberAfOperationalStateClusterStartCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::OperationalState::Commands::Start::DecodableType & commandData); +/** + * @brief Operational State Cluster Resume Command callback (from client) + */ +bool emberAfOperationalStateClusterResumeCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::OperationalState::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 221d18e5e7b70d..5188903dc05874 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 @@ -1360,6 +1360,35 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(SmokeCoAlarm::Sensitivi } } +static auto __attribute__((unused)) EnsureKnownEnumValue(OperationalState::ErrorStateEnum val) +{ + using EnumType = OperationalState::ErrorStateEnum; + switch (val) + { + case EnumType::kNoError: + case EnumType::kUnableToStartOrResume: + case EnumType::kUnableToCompleteOperation: + case EnumType::kCommandInvalidInState: + return val; + default: + return static_cast(4); + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(OperationalState::OperationalStateEnum val) +{ + using EnumType = OperationalState::OperationalStateEnum; + switch (val) + { + case EnumType::kStopped: + case EnumType::kRunning: + case EnumType::kPaused: + case EnumType::kError: + return val; + default: + return static_cast(4); + } +} + 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 2f371669f1657a..cf71fb2ec647cf 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 @@ -1630,6 +1630,37 @@ enum class Feature : uint32_t }; } // namespace SmokeCoAlarm +namespace OperationalState { + +// Enum for ErrorStateEnum +enum class ErrorStateEnum : uint8_t +{ + kNoError = 0x00, + kUnableToStartOrResume = 0x01, + kUnableToCompleteOperation = 0x02, + kCommandInvalidInState = 0x03, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 4, +}; + +// Enum for OperationalStateEnum +enum class OperationalStateEnum : uint8_t +{ + kStopped = 0x00, + kRunning = 0x01, + kPaused = 0x02, + kError = 0x03, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 4, +}; +} // namespace OperationalState + 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 2ae5a2a6bd892e..56dd2dd58df6b8 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 @@ -12226,6 +12226,409 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace SmokeCoAlarm +namespace OperationalState { +namespace Structs { +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 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 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(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 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; + } + } + + 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; + } + } + + 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 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::kErrorState), errorState)); + 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::kErrorState): + ReturnErrorOnFailure(DataModel::Decode(reader, errorState)); + break; + default: + break; + } + } + + 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 OperationalState namespace HepaFilterMonitoring { namespace Commands { @@ -26707,6 +27110,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::OperationalState::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 ba6e7dacdbbb4d..5568df5c6975b6 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 @@ -15310,6 +15310,446 @@ struct DecodableType } // namespace AllClear } // namespace Events } // 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 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::OperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::OperationalState::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::OperationalState::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::OperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::OperationalState::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::OperationalState::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::OperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::OperationalState::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::OperationalState::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::OperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::OperationalState::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::OperationalState::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::OperationalState::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::OperationalState::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::OperationalState::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::OperationalState::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::OperationalState::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; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::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::OperationalState::Structs::OperationalStateStruct::Type; + using DecodableType = chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::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::OperationalState::Structs::ErrorStateStruct::Type; + using DecodableType = chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::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::OperationalState::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::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::OperationalState::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::OperationalState::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::OperationalState::Id; } + static constexpr bool kIsFabricScoped = false; + + ErrorStateEnum 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::OperationalState::Id; } + + ErrorStateEnum completionErrorCode = static_cast(0); + Optional> totalOperationalTime; + Optional> pausedTime; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace OperationCompletion +} // namespace Events +} // namespace OperationalState 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 9bac487c0e5e17..88b4d8762d1b01 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 @@ -2675,6 +2675,60 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace SmokeCoAlarm +namespace OperationalState { +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 OperationalState + 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 9ca9cb672c00ef..fb421964765e65 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 @@ -163,6 +163,9 @@ static constexpr ClusterId Id = 0x0000005B; namespace SmokeCoAlarm { static constexpr ClusterId Id = 0x0000005C; } // namespace SmokeCoAlarm +namespace OperationalState { +static constexpr ClusterId Id = 0x00000060; +} // namespace OperationalState 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 9470493c02717a..566f589cb7ed9d 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 @@ -671,6 +671,32 @@ static constexpr CommandId Id = 0x00000000; } // namespace Commands } // namespace SmokeCoAlarm +namespace OperationalState { +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 OperationalState + 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 91ec9c29157909..cc23a3c7c6d1c6 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 @@ -327,6 +327,20 @@ static constexpr EventId Id = 0x0000000A; } // namespace Events } // namespace SmokeCoAlarm +namespace OperationalState { +namespace Events { + +namespace OperationalError { +static constexpr EventId Id = 0x00000000; +} // namespace OperationalError + +namespace OperationCompletion { +static constexpr EventId Id = 0x00000001; +} // namespace OperationCompletion + +} // namespace Events +} // namespace OperationalState + 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 3a80624fd90731..4b77fce6bf9afd 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 @@ -316,6 +316,12 @@ #define CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER #endif +#if defined(ZCL_USING_OPERATIONAL_STATE_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_STATE_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER { chip::app::Clusters::OperationalState::Id, "Operational State" }, +#else +#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_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" }, @@ -924,6 +930,7 @@ CHIP_PRINTCLUSTER_REFRIGERATOR_ALARM \ CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER \ CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER \ + CHIP_PRINTCLUSTER_OPERATIONAL_STATE_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 d5b2dbb52af1e5..8139b425a55c00 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -78,6 +78,7 @@ | RefrigeratorAlarm | 0x0057 | | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | +| OperationalState | 0x0060 | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -4271,6 +4272,150 @@ class SmokeCoAlarmSelfTestRequest : public ClusterCommand chip::app::Clusters::SmokeCoAlarm::Commands::SelfTestRequest::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster OperationalState | 0x0060 | +|------------------------------------------------------------------------------| +| 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 OperationalStatePause : public ClusterCommand +{ +public: + OperationalStatePause(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("pause", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) command (0x00000000) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000060, 0x00000000, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) command (0x00000000) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000060, 0x00000000, mRequest); + } + +private: + chip::app::Clusters::OperationalState::Commands::Pause::Type mRequest; +}; + +/* + * Command Stop + */ +class OperationalStateStop : public ClusterCommand +{ +public: + OperationalStateStop(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("stop", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) command (0x00000001) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000060, 0x00000001, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) command (0x00000001) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000060, 0x00000001, mRequest); + } + +private: + chip::app::Clusters::OperationalState::Commands::Stop::Type mRequest; +}; + +/* + * Command Start + */ +class OperationalStateStart : public ClusterCommand +{ +public: + OperationalStateStart(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("start", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) command (0x00000002) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000060, 0x00000002, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) command (0x00000002) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000060, 0x00000002, mRequest); + } + +private: + chip::app::Clusters::OperationalState::Commands::Start::Type mRequest; +}; + +/* + * Command Resume + */ +class OperationalStateResume : public ClusterCommand +{ +public: + OperationalStateResume(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("resume", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) command (0x00000003) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000060, 0x00000003, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) command (0x00000003) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000060, 0x00000003, mRequest); + } + +private: + chip::app::Clusters::OperationalState::Commands::Resume::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster HepaFilterMonitoring | 0x0071 | |------------------------------------------------------------------------------| @@ -14382,6 +14527,92 @@ void registerClusterSmokeCoAlarm(Commands & commands, CredentialIssuerCommands * commands.Register(clusterName, clusterCommands); } +void registerClusterOperationalState(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::OperationalState; + + const char * clusterName = "OperationalState"; + + 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>( + 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; @@ -23287,6 +23518,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterRefrigeratorAlarm(commands, credsIssuerConfig); registerClusterAirQuality(commands, credsIssuerConfig); registerClusterSmokeCoAlarm(commands, credsIssuerConfig); + registerClusterOperationalState(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 2e5bea9e2fb698..569a8e74ca92cd 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -1915,6 +1915,79 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::TemperatureControl::St ComplexArgumentParser::Finalize(request.temperatureLevel); } +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 a73e784a7dffd7..5bffae9e8d6294 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -239,6 +239,16 @@ static CHIP_ERROR Setup(const char * label, static void Finalize(chip::app::Clusters::TemperatureControl::Structs::TemperatureLevelStruct::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 81653db806d80a..6e7f0796fe81cc 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -1736,6 +1736,65 @@ 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) { @@ -3674,6 +3733,54 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Sm return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const OperationalState::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 OperationalState::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) { @@ -4392,6 +4499,14 @@ 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 OperationalState::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) { @@ -7950,6 +8065,74 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case OperationalState::Id: { + switch (path.mAttributeId) + { + case OperationalState::Attributes::PhaseList::Id: { + chip::app::DataModel::Nullable> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PhaseList", 1, value); + } + case OperationalState::Attributes::CurrentPhase::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentPhase", 1, value); + } + case OperationalState::Attributes::CountdownTime::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CountdownTime", 1, value); + } + case OperationalState::Attributes::OperationalStateList::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalStateList", 1, value); + } + case OperationalState::Attributes::OperationalState::Id: { + chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalState", 1, value); + } + case OperationalState::Attributes::OperationalError::Id: { + chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalError", 1, value); + } + case OperationalState::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case OperationalState::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case OperationalState::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case OperationalState::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case OperationalState::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case OperationalState::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) { @@ -15693,6 +15876,17 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case OperationalState::Id: { + switch (path.mCommandId) + { + case OperationalState::Commands::OperationalCommandResponse::Id: { + OperationalState::Commands::OperationalCommandResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalCommandResponse", 1, value); + } + } + break; + } case DoorLock::Id: { switch (path.mCommandId) { @@ -16289,6 +16483,22 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case OperationalState::Id: { + switch (header.mPath.mEventId) + { + case OperationalState::Events::OperationalError::Id: { + chip::app::Clusters::OperationalState::Events::OperationalError::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalError", 1, value); + } + case OperationalState::Events::OperationCompletion::Id: { + chip::app::Clusters::OperationalState::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 24df49586083b8..4819d5ec500168 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -149,6 +149,12 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::TemperatureControl::Structs::TemperatureLevelStruct::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); @@ -328,6 +334,10 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::SmokeCoAlarm::Events::InterconnectCOAlarm::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType & value); +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::DoorLock::Events::DoorLockAlarm::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, @@ -453,6 +463,9 @@ LogValue(const char * label, size_t indent, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType & value); +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::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 be76b9e826e391..65f4b62b962dc3 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -81,6 +81,7 @@ | RefrigeratorAlarm | 0x0057 | | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | +| OperationalState | 0x0060 | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -44151,6 +44152,1056 @@ class SubscribeAttributeSmokeCoAlarmClusterRevision : public SubscribeAttribute } }; +/*----------------------------------------------------------------------------*\ +| Cluster OperationalState | 0x0060 | +|------------------------------------------------------------------------------| +| 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 OperationalStatePause : public ClusterCommand { +public: + OperationalStatePause() + : ClusterCommand("pause") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTROperationalStateClusterPauseParams 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:^(MTROperationalStateClusterOperationalCommandResponseParams * _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 OperationalStateStop : public ClusterCommand { +public: + OperationalStateStop() + : ClusterCommand("stop") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) command (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTROperationalStateClusterStopParams 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:^(MTROperationalStateClusterOperationalCommandResponseParams * _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 OperationalStateStart : public ClusterCommand { +public: + OperationalStateStart() + : ClusterCommand("start") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) command (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTROperationalStateClusterStartParams 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:^(MTROperationalStateClusterOperationalCommandResponseParams * _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 OperationalStateResume : public ClusterCommand { +public: + OperationalStateResume() + : ClusterCommand("resume") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) command (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTROperationalStateClusterResumeParams 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:^(MTROperationalStateClusterOperationalCommandResponseParams * _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 ReadOperationalStatePhaseList : public ReadAttribute { +public: + ReadOperationalStatePhaseList() + : ReadAttribute("phase-list") + { + } + + ~ReadOperationalStatePhaseList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributePhaseListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.PhaseList response %@", [value description]); + if (error != nil) { + LogNSError("OperationalState PhaseList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeOperationalStatePhaseList : public SubscribeAttribute { +public: + SubscribeAttributeOperationalStatePhaseList() + : SubscribeAttribute("phase-list") + { + } + + ~SubscribeAttributeOperationalStatePhaseList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState 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(@"OperationalState.PhaseList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute CurrentPhase + */ +class ReadOperationalStateCurrentPhase : public ReadAttribute { +public: + ReadOperationalStateCurrentPhase() + : ReadAttribute("current-phase") + { + } + + ~ReadOperationalStateCurrentPhase() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeCurrentPhaseWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.CurrentPhase response %@", [value description]); + if (error != nil) { + LogNSError("OperationalState CurrentPhase read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeOperationalStateCurrentPhase : public SubscribeAttribute { +public: + SubscribeAttributeOperationalStateCurrentPhase() + : SubscribeAttribute("current-phase") + { + } + + ~SubscribeAttributeOperationalStateCurrentPhase() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState 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(@"OperationalState.CurrentPhase response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute CountdownTime + */ +class ReadOperationalStateCountdownTime : public ReadAttribute { +public: + ReadOperationalStateCountdownTime() + : ReadAttribute("countdown-time") + { + } + + ~ReadOperationalStateCountdownTime() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeCountdownTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.CountdownTime response %@", [value description]); + if (error != nil) { + LogNSError("OperationalState CountdownTime read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeOperationalStateCountdownTime : public SubscribeAttribute { +public: + SubscribeAttributeOperationalStateCountdownTime() + : SubscribeAttribute("countdown-time") + { + } + + ~SubscribeAttributeOperationalStateCountdownTime() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState 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(@"OperationalState.CountdownTime response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute OperationalStateList + */ +class ReadOperationalStateOperationalStateList : public ReadAttribute { +public: + ReadOperationalStateOperationalStateList() + : ReadAttribute("operational-state-list") + { + } + + ~ReadOperationalStateOperationalStateList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeOperationalStateListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.OperationalStateList response %@", [value description]); + if (error != nil) { + LogNSError("OperationalState OperationalStateList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeOperationalStateOperationalStateList : public SubscribeAttribute { +public: + SubscribeAttributeOperationalStateOperationalStateList() + : SubscribeAttribute("operational-state-list") + { + } + + ~SubscribeAttributeOperationalStateOperationalStateList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState 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(@"OperationalState.OperationalStateList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute OperationalState + */ +class ReadOperationalStateOperationalState : public ReadAttribute { +public: + ReadOperationalStateOperationalState() + : ReadAttribute("operational-state") + { + } + + ~ReadOperationalStateOperationalState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeOperationalStateWithCompletion:^( + MTROperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.OperationalState response %@", [value description]); + if (error != nil) { + LogNSError("OperationalState OperationalState read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeOperationalStateOperationalState : public SubscribeAttribute { +public: + SubscribeAttributeOperationalStateOperationalState() + : SubscribeAttribute("operational-state") + { + } + + ~SubscribeAttributeOperationalStateOperationalState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState 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:^(MTROperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.OperationalState response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute OperationalError + */ +class ReadOperationalStateOperationalError : public ReadAttribute { +public: + ReadOperationalStateOperationalError() + : ReadAttribute("operational-error") + { + } + + ~ReadOperationalStateOperationalError() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeOperationalErrorWithCompletion:^( + MTROperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.OperationalError response %@", [value description]); + if (error != nil) { + LogNSError("OperationalState OperationalError read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeOperationalStateOperationalError : public SubscribeAttribute { +public: + SubscribeAttributeOperationalStateOperationalError() + : SubscribeAttribute("operational-error") + { + } + + ~SubscribeAttributeOperationalStateOperationalError() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState 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:^(MTROperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.OperationalError response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadOperationalStateGeneratedCommandList : public ReadAttribute { +public: + ReadOperationalStateGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadOperationalStateGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.GeneratedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("OperationalState GeneratedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeOperationalStateGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeOperationalStateGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeOperationalStateGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState 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(@"OperationalState.GeneratedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadOperationalStateAcceptedCommandList : public ReadAttribute { +public: + ReadOperationalStateAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadOperationalStateAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.AcceptedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("OperationalState AcceptedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeOperationalStateAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeOperationalStateAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeOperationalStateAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState 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(@"OperationalState.AcceptedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute EventList + */ +class ReadOperationalStateEventList : public ReadAttribute { +public: + ReadOperationalStateEventList() + : ReadAttribute("event-list") + { + } + + ~ReadOperationalStateEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReadAttribute (0x0000FFFA) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.EventList response %@", [value description]); + if (error != nil) { + LogNSError("OperationalState EventList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeOperationalStateEventList : public SubscribeAttribute { +public: + SubscribeAttributeOperationalStateEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeOperationalStateEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReportAttribute (0x0000FFFA) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState 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(@"OperationalState.EventList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AttributeList + */ +class ReadOperationalStateAttributeList : public ReadAttribute { +public: + ReadOperationalStateAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadOperationalStateAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.AttributeList response %@", [value description]); + if (error != nil) { + LogNSError("OperationalState AttributeList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeOperationalStateAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeOperationalStateAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeOperationalStateAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState 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(@"OperationalState.AttributeList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute FeatureMap + */ +class ReadOperationalStateFeatureMap : public ReadAttribute { +public: + ReadOperationalStateFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadOperationalStateFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.FeatureMap response %@", [value description]); + if (error != nil) { + LogNSError("OperationalState FeatureMap read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeOperationalStateFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeOperationalStateFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeOperationalStateFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState 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(@"OperationalState.FeatureMap response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadOperationalStateClusterRevision : public ReadAttribute { +public: + ReadOperationalStateClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadOperationalStateClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalState.ClusterRevision response %@", [value description]); + if (error != nil) { + LogNSError("OperationalState ClusterRevision read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeOperationalStateClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeOperationalStateClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeOperationalStateClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000060) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterOperationalState 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(@"OperationalState.ClusterRevision response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + /*----------------------------------------------------------------------------*\ | Cluster HepaFilterMonitoring | 0x0071 | |------------------------------------------------------------------------------| @@ -160785,6 +161836,51 @@ void registerClusterSmokeCoAlarm(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterOperationalState(Commands & commands) +{ + using namespace chip::app::Clusters::OperationalState; + + const char * clusterName = "OperationalState"; + + 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; @@ -165120,6 +166216,7 @@ void registerClusters(Commands & commands) registerClusterRefrigeratorAlarm(commands); registerClusterAirQuality(commands); registerClusterSmokeCoAlarm(commands); + registerClusterOperationalState(commands); registerClusterHepaFilterMonitoring(commands); registerClusterActivatedCarbonFilterMonitoring(commands); registerClusterCeramicFilterMonitoring(commands);