diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index f9e4c95dd141eb..97c8e90e6ae692 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -56,6 +56,7 @@ + diff --git a/src/app/zap-templates/zcl/data-model/chip/replacable-monitoring-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/replacable-monitoring-cluster.xml index 5e7f23568ad6c6..2bfc7d05c5b1bd 100644 --- a/src/app/zap-templates/zcl/data-model/chip/replacable-monitoring-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/replacable-monitoring-cluster.xml @@ -84,7 +84,7 @@ limitations under the License. Measurement & Sensing Attributes and commands for monitoring electrostatic filters in a device 0x0074 - ELECTROSTATIC_FILTER_MONITORING + ELECTROSTATIC_FILTER_MONITORING_CLUSTER true true @@ -147,7 +147,7 @@ limitations under the License. Measurement & Sensing Attributes and commands for monitoring zeolite filters in a device 0x0077 - ZEOLITE_FILTER_MONITORING + ZEOLITE_FILTER_MONITORING_CLUSTER true true diff --git a/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml new file mode 100644 index 00000000000000..7401708aae91c4 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml @@ -0,0 +1,153 @@ + + + + + + + Closures + Smoke CO Alarm + 0x005C + SMOKE_CO_ALARM_CLUSTER + This cluster provides an interface for observing and managing the state of smoke and CO alarms. + + + + + + true + true + + + + + + + + ExpressedState + SmokeState + COState + BatteryAlert + DeviceMuted + TestInProgress + HardwareFaultAlert + EndOfServiceAlert + InterconnectSmokeAlarm + InterconnectCOAlarm + ContaminationState + SensitivityLevel + + + + + + This command SHALL initiate a device self-test. + + + + + This event SHALL be generated when SmokeState attribute changes to either Warning or Critical state. + + + This event SHALL be generated when COState attribute changes to either Warning or Critical state. + + + This event SHALL be generated when BatteryAlert attribute changes to either Warning or Critical state. + + + This event SHALL be generated when the device detects a hardware fault that leads to setting HardwareFaultAlert to True. + + + This event SHALL be generated when the EndOfServiceAlert is set to True. + + + This event SHALL be generated when the SelfTest completes, and the attribute TestInProgress changes to False. + + + This event SHALL be generated when the DeviceMuted attribute changes to True. + + + This event SHALL be generated when DeviceMuted attribute changes to False. + + + This event SHALL be generated when the device hosting the cluster receives a remote smoke alarm. + + + This event SHALL be generated when the device hosting the cluster receives a remote CO alarm. + + + This event SHALL be generated when ExpressedState attribute returns to Normal state. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 45ed3306e821e0..05dae33147d379 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -74,6 +74,7 @@ "relative-humidity-measurement-cluster.xml", "replacable-monitoring-cluster.xml", "scene.xml", + "smoke-co-alarm-cluster.xml", "software-diagnostics-cluster.xml", "switch-cluster.xml", "target-navigator-cluster.xml", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 4d3e4348ae18c0..9fd8c6caf9ec79 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -72,6 +72,7 @@ "relative-humidity-measurement-cluster.xml", "replacable-monitoring-cluster.xml", "scene.xml", + "smoke-co-alarm-cluster.xml", "software-diagnostics-cluster.xml", "switch-cluster.xml", "target-navigator-cluster.xml", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 333d629bc21e1f..d86183fb3e8a4b 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -76,6 +76,7 @@ "PWM_CLUSTER": [], "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [], "SCENES_CLUSTER": [], + "SMOKE_CO_ALARM_CLUSTER": [], "SOFTWARE_DIAGNOSTICS_CLUSTER": [], "SWITCH_CLUSTER": [], "TARGET_NAVIGATOR_CLUSTER": [], @@ -177,6 +178,7 @@ "PWM_CLUSTER": [], "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [], "SCENES_CLUSTER": ["scenes"], + "SMOKE_CO_ALARM_CLUSTER": [], "SOFTWARE_DIAGNOSTICS_CLUSTER": ["software-diagnostics-server"], "SWITCH_CLUSTER": ["switch-server"], "TARGET_NAVIGATOR_CLUSTER": ["target-navigator-server"], diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index 69ffd6f2e36488..b4944bad11436c 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -176,6 +176,8 @@ if (current_os == "android" || build_java_matter_controller) { "jni/RelativeHumidityMeasurementClient-ReadImpl.cpp", "jni/ScenesClient-InvokeSubscribeImpl.cpp", "jni/ScenesClient-ReadImpl.cpp", + "jni/SmokeCoAlarmClient-ReadImpl.cpp", + "jni/SmokeCoAlarmClient-InvokeSubscribeImpl.cpp", "jni/SoftwareDiagnosticsClient-InvokeSubscribeImpl.cpp", "jni/SoftwareDiagnosticsClient-ReadImpl.cpp", "jni/SwitchClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 13d57667665187..f17dd261202ba4 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2800,6 +2800,114 @@ client cluster AirQuality = 91 { readonly attribute int16u clusterRevision = 65533; } +/** This cluster provides an interface for observing and managing the state of smoke and CO alarms. */ +client cluster SmokeCoAlarm = 92 { + enum AlarmStateEnum : ENUM8 { + kUnknown = 0; + kNormal = 1; + kWarning = 2; + kCritical = 3; + } + + enum ContaminationStateEnum : ENUM8 { + kUnknown = 0; + kNormal = 1; + kLow = 2; + kWarning = 3; + kCritical = 4; + } + + enum EndOfServiceEnum : ENUM8 { + kUnknown = 0; + kExpired = 1; + kNormal = 2; + } + + enum ExpressedStateEnum : ENUM8 { + kNormal = 0; + kSmokeAlarm = 1; + kCOAlarm = 2; + kBatteryAlert = 3; + kTesting = 4; + kHardwareFault = 5; + kEndOfService = 6; + kInterconnectSmoke = 7; + kInterconnectCO = 8; + } + + enum MuteStateEnum : ENUM8 { + kUnknown = 0; + kNotMuted = 1; + kMuted = 2; + } + + enum SensitivityEnum : ENUM8 { + kHigh = 0; + kStandard = 1; + kLow = 2; + } + + bitmap SmokeCOAlarmFeature : BITMAP32 { + kSmokeAlarm = 0x1; + kCoAlarm = 0x2; + } + + info event SmokeAlarm = 0 { + } + + info event COAlarm = 1 { + } + + info event LowBattery = 2 { + } + + info event HardwareFault = 3 { + } + + info event EndOfService = 4 { + } + + info event SelfTestComplete = 5 { + } + + info event AlarmMuted = 6 { + } + + info event MuteEnded = 7 { + } + + info event InterconnectSmokeAlarm = 8 { + } + + info event InterconnectCOAlarm = 9 { + } + + info event AllClear = 10 { + } + + readonly attribute ExpressedStateEnum expressedState = 0; + readonly attribute optional AlarmStateEnum smokeState = 1; + readonly attribute optional AlarmStateEnum COState = 2; + readonly attribute AlarmStateEnum batteryAlert = 3; + readonly attribute optional MuteStateEnum deviceMuted = 4; + readonly attribute boolean testInProgress = 5; + readonly attribute boolean hardwareFaultAlert = 6; + readonly attribute EndOfServiceEnum endOfServiceAlert = 7; + readonly attribute optional AlarmStateEnum interconnectSmokeAlarm = 8; + readonly attribute optional AlarmStateEnum interconnectCOAlarm = 9; + readonly attribute optional ContaminationStateEnum contaminationState = 10; + attribute optional SensitivityEnum sensitivityLevel = 11; + 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; + + /** This command SHALL initiate a device self-test. */ + command SelfTestRequest(): DefaultSuccess = 0; +} + /** 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 671ff4fad1ee38..d52d30e81ac43c 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -16,12 +16,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../app/zap-templates/zcl/zcl.json", @@ -29,6 +23,12 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" } ], "endpointTypes": [ @@ -9883,7 +9883,7 @@ "side": "server", "type": "array", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -9931,7 +9931,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -9947,7 +9947,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -9963,7 +9963,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -9979,7 +9979,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10349,7 +10349,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10365,7 +10365,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10381,7 +10381,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10397,7 +10397,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10440,6 +10440,356 @@ } ] }, + { + "name": "Smoke CO Alarm", + "code": 92, + "mfgCode": null, + "define": "SMOKE_CO_ALARM_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "SelfTestRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 0, + "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": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Smoke CO Alarm", + "code": 92, + "mfgCode": null, + "define": "SMOKE_CO_ALARM_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "ExpressedState", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "ExpressedStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SmokeState", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "AlarmStateEnum", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "COState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "AlarmStateEnum", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatteryAlert", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "AlarmStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DeviceMuted", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "MuteStateEnum", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestInProgress", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HardwareFaultAlert", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EndOfServiceAlert", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "EndOfServiceEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterconnectSmokeAlarm", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "AlarmStateEnum", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterconnectCOAlarm", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "AlarmStateEnum", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ContaminationState", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "ContaminationStateEnum", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SensitivityLevel", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "SensitivityEnum", + "included": 0, + "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": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "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, @@ -10561,7 +10911,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10577,7 +10927,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10593,7 +10943,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10609,7 +10959,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10773,7 +11123,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10789,7 +11139,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10805,7 +11155,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10821,7 +11171,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10985,7 +11335,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11001,7 +11351,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11017,7 +11367,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11033,7 +11383,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11197,7 +11547,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11213,7 +11563,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11229,7 +11579,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11245,7 +11595,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11409,7 +11759,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11425,7 +11775,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11441,7 +11791,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11457,7 +11807,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11621,7 +11971,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11637,7 +11987,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11653,7 +12003,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11669,7 +12019,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11833,7 +12183,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11849,7 +12199,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11865,7 +12215,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11881,7 +12231,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12045,7 +12395,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12061,7 +12411,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12077,7 +12427,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12093,7 +12443,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12257,7 +12607,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12273,7 +12623,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12289,7 +12639,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12305,7 +12655,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12469,7 +12819,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12485,7 +12835,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12501,7 +12851,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12517,7 +12867,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12681,7 +13031,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12697,7 +13047,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12713,7 +13063,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12729,7 +13079,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12893,7 +13243,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12909,7 +13259,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12925,7 +13275,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12941,7 +13291,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index da9947fda4e402..e9c9ad74118d7b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -7877,6 +7877,243 @@ private static Map readAirQualityInteractionInfo() { return result; } + private static Map readSmokeCoAlarmInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readSmokeCoAlarmExpressedStateCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmExpressedStateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readExpressedStateAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSmokeCoAlarmExpressedStateCommandParams); + result.put( + "readExpressedStateAttribute", readSmokeCoAlarmExpressedStateAttributeInteractionInfo); + Map readSmokeCoAlarmSmokeStateCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmSmokeStateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readSmokeStateAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSmokeCoAlarmSmokeStateCommandParams); + result.put("readSmokeStateAttribute", readSmokeCoAlarmSmokeStateAttributeInteractionInfo); + Map readSmokeCoAlarmCOStateCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmCOStateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readCOStateAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSmokeCoAlarmCOStateCommandParams); + result.put("readCOStateAttribute", readSmokeCoAlarmCOStateAttributeInteractionInfo); + Map readSmokeCoAlarmBatteryAlertCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmBatteryAlertAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readBatteryAlertAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSmokeCoAlarmBatteryAlertCommandParams); + result.put("readBatteryAlertAttribute", readSmokeCoAlarmBatteryAlertAttributeInteractionInfo); + Map readSmokeCoAlarmDeviceMutedCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmDeviceMutedAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readDeviceMutedAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSmokeCoAlarmDeviceMutedCommandParams); + result.put("readDeviceMutedAttribute", readSmokeCoAlarmDeviceMutedAttributeInteractionInfo); + Map readSmokeCoAlarmTestInProgressCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmTestInProgressAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readTestInProgressAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readSmokeCoAlarmTestInProgressCommandParams); + result.put( + "readTestInProgressAttribute", readSmokeCoAlarmTestInProgressAttributeInteractionInfo); + Map readSmokeCoAlarmHardwareFaultAlertCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmHardwareFaultAlertAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readHardwareFaultAlertAttribute( + (ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readSmokeCoAlarmHardwareFaultAlertCommandParams); + result.put( + "readHardwareFaultAlertAttribute", + readSmokeCoAlarmHardwareFaultAlertAttributeInteractionInfo); + Map readSmokeCoAlarmEndOfServiceAlertCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmEndOfServiceAlertAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readEndOfServiceAlertAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSmokeCoAlarmEndOfServiceAlertCommandParams); + result.put( + "readEndOfServiceAlertAttribute", + readSmokeCoAlarmEndOfServiceAlertAttributeInteractionInfo); + Map readSmokeCoAlarmInterconnectSmokeAlarmCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmInterconnectSmokeAlarmAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readInterconnectSmokeAlarmAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSmokeCoAlarmInterconnectSmokeAlarmCommandParams); + result.put( + "readInterconnectSmokeAlarmAttribute", + readSmokeCoAlarmInterconnectSmokeAlarmAttributeInteractionInfo); + Map readSmokeCoAlarmInterconnectCOAlarmCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmInterconnectCOAlarmAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readInterconnectCOAlarmAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSmokeCoAlarmInterconnectCOAlarmCommandParams); + result.put( + "readInterconnectCOAlarmAttribute", + readSmokeCoAlarmInterconnectCOAlarmAttributeInteractionInfo); + Map readSmokeCoAlarmContaminationStateCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmContaminationStateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readContaminationStateAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSmokeCoAlarmContaminationStateCommandParams); + result.put( + "readContaminationStateAttribute", + readSmokeCoAlarmContaminationStateAttributeInteractionInfo); + Map readSmokeCoAlarmSensitivityLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmSensitivityLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readSensitivityLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSmokeCoAlarmSensitivityLevelCommandParams); + result.put( + "readSensitivityLevelAttribute", readSmokeCoAlarmSensitivityLevelAttributeInteractionInfo); + Map readSmokeCoAlarmGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.SmokeCoAlarmCluster.GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedSmokeCoAlarmClusterGeneratedCommandListAttributeCallback(), + readSmokeCoAlarmGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readSmokeCoAlarmGeneratedCommandListAttributeInteractionInfo); + Map readSmokeCoAlarmAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.SmokeCoAlarmCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedSmokeCoAlarmClusterAcceptedCommandListAttributeCallback(), + readSmokeCoAlarmAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readSmokeCoAlarmAcceptedCommandListAttributeInteractionInfo); + Map readSmokeCoAlarmEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readEventListAttribute( + (ChipClusters.SmokeCoAlarmCluster.EventListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedSmokeCoAlarmClusterEventListAttributeCallback(), + readSmokeCoAlarmEventListCommandParams); + result.put("readEventListAttribute", readSmokeCoAlarmEventListAttributeInteractionInfo); + Map readSmokeCoAlarmAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.SmokeCoAlarmCluster.AttributeListAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping.DelegatedSmokeCoAlarmClusterAttributeListAttributeCallback(), + readSmokeCoAlarmAttributeListCommandParams); + result.put("readAttributeListAttribute", readSmokeCoAlarmAttributeListAttributeInteractionInfo); + Map readSmokeCoAlarmFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readSmokeCoAlarmFeatureMapCommandParams); + result.put("readFeatureMapAttribute", readSmokeCoAlarmFeatureMapAttributeInteractionInfo); + Map readSmokeCoAlarmClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readSmokeCoAlarmClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSmokeCoAlarmClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", readSmokeCoAlarmClusterRevisionAttributeInteractionInfo); + + return result; + } + private static Map readHepaFilterMonitoringInteractionInfo() { Map result = new LinkedHashMap<>(); Map readHepaFilterMonitoringConditionCommandParams = @@ -19288,6 +19525,7 @@ public Map> getReadAttributeMap() { put("icdManagement", readIcdManagementInteractionInfo()); put("modeSelect", readModeSelectInteractionInfo()); put("airQuality", readAirQualityInteractionInfo()); + put("smokeCoAlarm", readSmokeCoAlarmInteractionInfo()); put("hepaFilterMonitoring", readHepaFilterMonitoringInteractionInfo()); put( "activatedCarbonFilterMonitoring", diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index b58f840370f8a2..b81fdbe9e321fa 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -639,6 +639,26 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("modeSelect", writeModeSelectInteractionInfo); Map writeAirQualityInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("airQuality", writeAirQualityInteractionInfo); + Map writeSmokeCoAlarmInteractionInfo = new LinkedHashMap<>(); + Map writeSmokeCoAlarmSensitivityLevelCommandParams = + new LinkedHashMap(); + CommandParameterInfo smokeCoAlarmsensitivityLevelCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeSmokeCoAlarmSensitivityLevelCommandParams.put( + "value", smokeCoAlarmsensitivityLevelCommandParameterInfo); + InteractionInfo writeSmokeCoAlarmSensitivityLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .writeSensitivityLevelAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeSmokeCoAlarmSensitivityLevelCommandParams); + writeSmokeCoAlarmInteractionInfo.put( + "writeSensitivityLevelAttribute", + writeSmokeCoAlarmSensitivityLevelAttributeInteractionInfo); + writeAttributeMap.put("smokeCoAlarm", writeSmokeCoAlarmInteractionInfo); Map writeHepaFilterMonitoringInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("hepaFilterMonitoring", writeHepaFilterMonitoringInteractionInfo); Map writeActivatedCarbonFilterMonitoringInteractionInfo = diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 769ead58483f84..bd2486993d2a2a 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -12325,6 +12325,322 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::SmokeCoAlarm::Id: { + using namespace app::Clusters::SmokeCoAlarm; + switch (aPath.mAttributeId) + { + case Attributes::ExpressedState::Id: { + using TypeInfo = Attributes::ExpressedState::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(), + static_cast(cppValue), value); + return value; + } + case Attributes::SmokeState::Id: { + using TypeInfo = Attributes::SmokeState::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(), + static_cast(cppValue), value); + return value; + } + case Attributes::COState::Id: { + using TypeInfo = Attributes::COState::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(), + static_cast(cppValue), value); + return value; + } + case Attributes::BatteryAlert::Id: { + using TypeInfo = Attributes::BatteryAlert::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(), + static_cast(cppValue), value); + return value; + } + case Attributes::DeviceMuted::Id: { + using TypeInfo = Attributes::DeviceMuted::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(), + static_cast(cppValue), value); + return value; + } + case Attributes::TestInProgress::Id: { + using TypeInfo = Attributes::TestInProgress::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), cppValue, + value); + return value; + } + case Attributes::HardwareFaultAlert::Id: { + using TypeInfo = Attributes::HardwareFaultAlert::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), cppValue, + value); + return value; + } + case Attributes::EndOfServiceAlert::Id: { + using TypeInfo = Attributes::EndOfServiceAlert::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(), + static_cast(cppValue), value); + return value; + } + case Attributes::InterconnectSmokeAlarm::Id: { + using TypeInfo = Attributes::InterconnectSmokeAlarm::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(), + static_cast(cppValue), value); + return value; + } + case Attributes::InterconnectCOAlarm::Id: { + using TypeInfo = Attributes::InterconnectCOAlarm::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(), + static_cast(cppValue), value); + return value; + } + case Attributes::ContaminationState::Id: { + using TypeInfo = Attributes::ContaminationState::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(), + static_cast(cppValue), value); + return value; + } + case Attributes::SensitivityLevel::Id: { + using TypeInfo = Attributes::SensitivityLevel::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(), + static_cast(cppValue), value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + 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/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index 704671c5d5fa20..b55e2d66de81f9 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -2342,6 +2342,58 @@ JNI_METHOD(void, ModeSelectCluster, writeOnModeAttribute) onFailure.release(); } +JNI_METHOD(void, SmokeCoAlarmCluster, writeSensitivityLevelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::SmokeCoAlarm::Attributes::SensitivityLevel::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + SmokeCoAlarmCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, DoorLockCluster, writeDoorOpenEventsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 9889badb090a46..b1f2729ac86888 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -2432,6 +2432,305 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::SmokeCoAlarm::Id: { + using namespace app::Clusters::SmokeCoAlarm; + switch (aPath.mEventId) + { + case Events::SmokeAlarm::Id: { + Events::SmokeAlarm::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass smokeAlarmStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$SmokeCoAlarmClusterSmokeAlarmEvent", smokeAlarmStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$SmokeCoAlarmClusterSmokeAlarmEvent"); + return nullptr; + } + jmethodID smokeAlarmStructCtor = env->GetMethodID(smokeAlarmStructClass, "", "()V"); + if (smokeAlarmStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$SmokeCoAlarmClusterSmokeAlarmEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(smokeAlarmStructClass, smokeAlarmStructCtor); + + return value; + } + case Events::COAlarm::Id: { + Events::COAlarm::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass COAlarmStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$SmokeCoAlarmClusterCOAlarmEvent", COAlarmStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$SmokeCoAlarmClusterCOAlarmEvent"); + return nullptr; + } + jmethodID COAlarmStructCtor = env->GetMethodID(COAlarmStructClass, "", "()V"); + if (COAlarmStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$SmokeCoAlarmClusterCOAlarmEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(COAlarmStructClass, COAlarmStructCtor); + + return value; + } + case Events::LowBattery::Id: { + Events::LowBattery::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass lowBatteryStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$SmokeCoAlarmClusterLowBatteryEvent", lowBatteryStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$SmokeCoAlarmClusterLowBatteryEvent"); + return nullptr; + } + jmethodID lowBatteryStructCtor = env->GetMethodID(lowBatteryStructClass, "", "()V"); + if (lowBatteryStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$SmokeCoAlarmClusterLowBatteryEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(lowBatteryStructClass, lowBatteryStructCtor); + + return value; + } + case Events::HardwareFault::Id: { + Events::HardwareFault::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass hardwareFaultStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$SmokeCoAlarmClusterHardwareFaultEvent", hardwareFaultStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$SmokeCoAlarmClusterHardwareFaultEvent"); + return nullptr; + } + jmethodID hardwareFaultStructCtor = env->GetMethodID(hardwareFaultStructClass, "", "()V"); + if (hardwareFaultStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$SmokeCoAlarmClusterHardwareFaultEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(hardwareFaultStructClass, hardwareFaultStructCtor); + + return value; + } + case Events::EndOfService::Id: { + Events::EndOfService::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass endOfServiceStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$SmokeCoAlarmClusterEndOfServiceEvent", endOfServiceStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$SmokeCoAlarmClusterEndOfServiceEvent"); + return nullptr; + } + jmethodID endOfServiceStructCtor = env->GetMethodID(endOfServiceStructClass, "", "()V"); + if (endOfServiceStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$SmokeCoAlarmClusterEndOfServiceEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(endOfServiceStructClass, endOfServiceStructCtor); + + return value; + } + case Events::SelfTestComplete::Id: { + Events::SelfTestComplete::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass selfTestCompleteStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$SmokeCoAlarmClusterSelfTestCompleteEvent", + selfTestCompleteStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$SmokeCoAlarmClusterSelfTestCompleteEvent"); + return nullptr; + } + jmethodID selfTestCompleteStructCtor = env->GetMethodID(selfTestCompleteStructClass, "", "()V"); + if (selfTestCompleteStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$SmokeCoAlarmClusterSelfTestCompleteEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(selfTestCompleteStructClass, selfTestCompleteStructCtor); + + return value; + } + case Events::AlarmMuted::Id: { + Events::AlarmMuted::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass alarmMutedStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$SmokeCoAlarmClusterAlarmMutedEvent", alarmMutedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$SmokeCoAlarmClusterAlarmMutedEvent"); + return nullptr; + } + jmethodID alarmMutedStructCtor = env->GetMethodID(alarmMutedStructClass, "", "()V"); + if (alarmMutedStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$SmokeCoAlarmClusterAlarmMutedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(alarmMutedStructClass, alarmMutedStructCtor); + + return value; + } + case Events::MuteEnded::Id: { + Events::MuteEnded::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass muteEndedStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$SmokeCoAlarmClusterMuteEndedEvent", muteEndedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$SmokeCoAlarmClusterMuteEndedEvent"); + return nullptr; + } + jmethodID muteEndedStructCtor = env->GetMethodID(muteEndedStructClass, "", "()V"); + if (muteEndedStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$SmokeCoAlarmClusterMuteEndedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(muteEndedStructClass, muteEndedStructCtor); + + return value; + } + case Events::InterconnectSmokeAlarm::Id: { + Events::InterconnectSmokeAlarm::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass interconnectSmokeAlarmStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$SmokeCoAlarmClusterInterconnectSmokeAlarmEvent", + interconnectSmokeAlarmStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$SmokeCoAlarmClusterInterconnectSmokeAlarmEvent"); + return nullptr; + } + jmethodID interconnectSmokeAlarmStructCtor = env->GetMethodID(interconnectSmokeAlarmStructClass, "", "()V"); + if (interconnectSmokeAlarmStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$SmokeCoAlarmClusterInterconnectSmokeAlarmEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(interconnectSmokeAlarmStructClass, interconnectSmokeAlarmStructCtor); + + return value; + } + case Events::InterconnectCOAlarm::Id: { + Events::InterconnectCOAlarm::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass interconnectCOAlarmStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$SmokeCoAlarmClusterInterconnectCOAlarmEvent", + interconnectCOAlarmStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$SmokeCoAlarmClusterInterconnectCOAlarmEvent"); + return nullptr; + } + jmethodID interconnectCOAlarmStructCtor = env->GetMethodID(interconnectCOAlarmStructClass, "", "()V"); + if (interconnectCOAlarmStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$SmokeCoAlarmClusterInterconnectCOAlarmEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(interconnectCOAlarmStructClass, interconnectCOAlarmStructCtor); + + return value; + } + case Events::AllClear::Id: { + Events::AllClear::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass allClearStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$SmokeCoAlarmClusterAllClearEvent", allClearStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$SmokeCoAlarmClusterAllClearEvent"); + return nullptr; + } + jmethodID allClearStructCtor = env->GetMethodID(allClearStructClass, "", "()V"); + if (allClearStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$SmokeCoAlarmClusterAllClearEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(allClearStructClass, allClearStructCtor); + + 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/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 484a3887c3523f..9f174184eab969 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -20512,6 +20512,288 @@ void CHIPAirQualityAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPSmokeCoAlarmGeneratedCommandListAttributeCallback::CHIPSmokeCoAlarmGeneratedCommandListAttributeCallback(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"); + } +} + +CHIPSmokeCoAlarmGeneratedCommandListAttributeCallback::~CHIPSmokeCoAlarmGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPSmokeCoAlarmGeneratedCommandListAttributeCallback::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); +} + +CHIPSmokeCoAlarmAcceptedCommandListAttributeCallback::CHIPSmokeCoAlarmAcceptedCommandListAttributeCallback(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"); + } +} + +CHIPSmokeCoAlarmAcceptedCommandListAttributeCallback::~CHIPSmokeCoAlarmAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPSmokeCoAlarmAcceptedCommandListAttributeCallback::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); +} + +CHIPSmokeCoAlarmEventListAttributeCallback::CHIPSmokeCoAlarmEventListAttributeCallback(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"); + } +} + +CHIPSmokeCoAlarmEventListAttributeCallback::~CHIPSmokeCoAlarmEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPSmokeCoAlarmEventListAttributeCallback::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); +} + +CHIPSmokeCoAlarmAttributeListAttributeCallback::CHIPSmokeCoAlarmAttributeListAttributeCallback(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"); + } +} + +CHIPSmokeCoAlarmAttributeListAttributeCallback::~CHIPSmokeCoAlarmAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPSmokeCoAlarmAttributeListAttributeCallback::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 61de68fd55d4a2..783482906b22e0 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -14040,6 +14040,357 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } + public static class SmokeCoAlarmCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 92L; + + public SmokeCoAlarmCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void selfTestRequest(DefaultClusterCallback callback) { + selfTestRequest(chipClusterPtr, callback, null); + } + + public void selfTestRequest(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + + selfTestRequest(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + private native void selfTestRequest( + long chipClusterPtr, + DefaultClusterCallback Callback, + @Nullable Integer timedInvokeTimeoutMs); + + 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 readExpressedStateAttribute(IntegerAttributeCallback callback) { + readExpressedStateAttribute(chipClusterPtr, callback); + } + + public void subscribeExpressedStateAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeExpressedStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readSmokeStateAttribute(IntegerAttributeCallback callback) { + readSmokeStateAttribute(chipClusterPtr, callback); + } + + public void subscribeSmokeStateAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSmokeStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCOStateAttribute(IntegerAttributeCallback callback) { + readCOStateAttribute(chipClusterPtr, callback); + } + + public void subscribeCOStateAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeCOStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBatteryAlertAttribute(IntegerAttributeCallback callback) { + readBatteryAlertAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryAlertAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryAlertAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readDeviceMutedAttribute(IntegerAttributeCallback callback) { + readDeviceMutedAttribute(chipClusterPtr, callback); + } + + public void subscribeDeviceMutedAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeDeviceMutedAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readTestInProgressAttribute(BooleanAttributeCallback callback) { + readTestInProgressAttribute(chipClusterPtr, callback); + } + + public void subscribeTestInProgressAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + subscribeTestInProgressAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readHardwareFaultAlertAttribute(BooleanAttributeCallback callback) { + readHardwareFaultAlertAttribute(chipClusterPtr, callback); + } + + public void subscribeHardwareFaultAlertAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + subscribeHardwareFaultAlertAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEndOfServiceAlertAttribute(IntegerAttributeCallback callback) { + readEndOfServiceAlertAttribute(chipClusterPtr, callback); + } + + public void subscribeEndOfServiceAlertAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEndOfServiceAlertAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readInterconnectSmokeAlarmAttribute(IntegerAttributeCallback callback) { + readInterconnectSmokeAlarmAttribute(chipClusterPtr, callback); + } + + public void subscribeInterconnectSmokeAlarmAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeInterconnectSmokeAlarmAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readInterconnectCOAlarmAttribute(IntegerAttributeCallback callback) { + readInterconnectCOAlarmAttribute(chipClusterPtr, callback); + } + + public void subscribeInterconnectCOAlarmAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeInterconnectCOAlarmAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readContaminationStateAttribute(IntegerAttributeCallback callback) { + readContaminationStateAttribute(chipClusterPtr, callback); + } + + public void subscribeContaminationStateAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeContaminationStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readSensitivityLevelAttribute(IntegerAttributeCallback callback) { + readSensitivityLevelAttribute(chipClusterPtr, callback); + } + + public void writeSensitivityLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeSensitivityLevelAttribute(chipClusterPtr, callback, value, null); + } + + public void writeSensitivityLevelAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeSensitivityLevelAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeSensitivityLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSensitivityLevelAttribute(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 readExpressedStateAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeExpressedStateAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readSmokeStateAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeSmokeStateAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readCOStateAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeCOStateAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readBatteryAlertAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeBatteryAlertAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readDeviceMutedAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeDeviceMutedAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readTestInProgressAttribute( + long chipClusterPtr, BooleanAttributeCallback callback); + + private native void subscribeTestInProgressAttribute( + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); + + private native void readHardwareFaultAlertAttribute( + long chipClusterPtr, BooleanAttributeCallback callback); + + private native void subscribeHardwareFaultAlertAttribute( + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); + + private native void readEndOfServiceAlertAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeEndOfServiceAlertAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readInterconnectSmokeAlarmAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeInterconnectSmokeAlarmAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readInterconnectCOAlarmAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeInterconnectCOAlarmAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readContaminationStateAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeContaminationStateAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readSensitivityLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeSensitivityLevelAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeSensitivityLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback 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 222ed166cc4333..2e78872d227fd6 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -963,6 +963,149 @@ public String toString() { } } + public static class SmokeCoAlarmClusterSmokeAlarmEvent { + + public SmokeCoAlarmClusterSmokeAlarmEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("SmokeCoAlarmClusterSmokeAlarmEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class SmokeCoAlarmClusterCOAlarmEvent { + + public SmokeCoAlarmClusterCOAlarmEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("SmokeCoAlarmClusterCOAlarmEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class SmokeCoAlarmClusterLowBatteryEvent { + + public SmokeCoAlarmClusterLowBatteryEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("SmokeCoAlarmClusterLowBatteryEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class SmokeCoAlarmClusterHardwareFaultEvent { + + public SmokeCoAlarmClusterHardwareFaultEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("SmokeCoAlarmClusterHardwareFaultEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class SmokeCoAlarmClusterEndOfServiceEvent { + + public SmokeCoAlarmClusterEndOfServiceEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("SmokeCoAlarmClusterEndOfServiceEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class SmokeCoAlarmClusterSelfTestCompleteEvent { + + public SmokeCoAlarmClusterSelfTestCompleteEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("SmokeCoAlarmClusterSelfTestCompleteEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class SmokeCoAlarmClusterAlarmMutedEvent { + + public SmokeCoAlarmClusterAlarmMutedEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("SmokeCoAlarmClusterAlarmMutedEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class SmokeCoAlarmClusterMuteEndedEvent { + + public SmokeCoAlarmClusterMuteEndedEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("SmokeCoAlarmClusterMuteEndedEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class SmokeCoAlarmClusterInterconnectSmokeAlarmEvent { + + public SmokeCoAlarmClusterInterconnectSmokeAlarmEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("SmokeCoAlarmClusterInterconnectSmokeAlarmEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class SmokeCoAlarmClusterInterconnectCOAlarmEvent { + + public SmokeCoAlarmClusterInterconnectCOAlarmEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("SmokeCoAlarmClusterInterconnectCOAlarmEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class SmokeCoAlarmClusterAllClearEvent { + + public SmokeCoAlarmClusterAllClearEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("SmokeCoAlarmClusterAllClearEvent {\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 d6b41b24ba33de..436fd8eb0aac41 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -154,6 +154,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 91L) { return "AirQuality"; } + if (clusterId == 92L) { + return "SmokeCoAlarm"; + } if (clusterId == 113L) { return "HepaFilterMonitoring"; } @@ -2052,6 +2055,63 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 92L) { + if (attributeId == 0L) { + return "ExpressedState"; + } + if (attributeId == 1L) { + return "SmokeState"; + } + if (attributeId == 2L) { + return "COState"; + } + if (attributeId == 3L) { + return "BatteryAlert"; + } + if (attributeId == 4L) { + return "DeviceMuted"; + } + if (attributeId == 5L) { + return "TestInProgress"; + } + if (attributeId == 6L) { + return "HardwareFaultAlert"; + } + if (attributeId == 7L) { + return "EndOfServiceAlert"; + } + if (attributeId == 8L) { + return "InterconnectSmokeAlarm"; + } + if (attributeId == 9L) { + return "InterconnectCOAlarm"; + } + if (attributeId == 10L) { + return "ContaminationState"; + } + if (attributeId == 11L) { + return "SensitivityLevel"; + } + 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"; @@ -4829,6 +4889,42 @@ public static String eventIdToName(long clusterId, long eventId) { if (clusterId == 91L) { return ""; } + if (clusterId == 92L) { + if (eventId == 0L) { + return "SmokeAlarm"; + } + if (eventId == 1L) { + return "COAlarm"; + } + if (eventId == 2L) { + return "LowBattery"; + } + if (eventId == 3L) { + return "HardwareFault"; + } + if (eventId == 4L) { + return "EndOfService"; + } + if (eventId == 5L) { + return "SelfTestComplete"; + } + if (eventId == 6L) { + return "AlarmMuted"; + } + if (eventId == 7L) { + return "MuteEnded"; + } + if (eventId == 8L) { + return "InterconnectSmokeAlarm"; + } + if (eventId == 9L) { + return "InterconnectCOAlarm"; + } + if (eventId == 10L) { + return "AllClear"; + } + return ""; + } if (clusterId == 113L) { return ""; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index a85e4501ab5996..c263cb7b870b97 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -7462,6 +7462,102 @@ public void onError(Exception ex) { } } + public static class DelegatedSmokeCoAlarmClusterGeneratedCommandListAttributeCallback + implements ChipClusters.SmokeCoAlarmCluster.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 DelegatedSmokeCoAlarmClusterAcceptedCommandListAttributeCallback + implements ChipClusters.SmokeCoAlarmCluster.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 DelegatedSmokeCoAlarmClusterEventListAttributeCallback + implements ChipClusters.SmokeCoAlarmCluster.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 DelegatedSmokeCoAlarmClusterAttributeListAttributeCallback + implements ChipClusters.SmokeCoAlarmCluster.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 { @@ -15455,6 +15551,11 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.AirQualityCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("airQuality", airQualityClusterInfo); + ClusterInfo smokeCoAlarmClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.SmokeCoAlarmCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("smokeCoAlarm", smokeCoAlarmClusterInfo); ClusterInfo hepaFilterMonitoringClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.HepaFilterMonitoringCluster(ptr, endpointId), @@ -15736,6 +15837,7 @@ public void combineCommand( destination.get("icdManagement").combineCommands(source.get("icdManagement")); destination.get("modeSelect").combineCommands(source.get("modeSelect")); destination.get("airQuality").combineCommands(source.get("airQuality")); + destination.get("smokeCoAlarm").combineCommands(source.get("smokeCoAlarm")); destination.get("hepaFilterMonitoring").combineCommands(source.get("hepaFilterMonitoring")); destination .get("activatedCarbonFilterMonitoring") @@ -17895,6 +17997,20 @@ public Map> getCommandMap() { commandMap.put("modeSelect", modeSelectClusterInteractionInfoMap); Map airQualityClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("airQuality", airQualityClusterInteractionInfoMap); + Map smokeCoAlarmClusterInteractionInfoMap = new LinkedHashMap<>(); + Map smokeCoAlarmselfTestRequestCommandParams = + new LinkedHashMap(); + InteractionInfo smokeCoAlarmselfTestRequestInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .selfTestRequest((DefaultClusterCallback) callback); + }, + () -> new DelegatedDefaultClusterCallback(), + smokeCoAlarmselfTestRequestCommandParams); + smokeCoAlarmClusterInteractionInfoMap.put( + "selfTestRequest", smokeCoAlarmselfTestRequestInteractionInfo); + commandMap.put("smokeCoAlarm", smokeCoAlarmClusterInteractionInfoMap); 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 16a413ea55902b..b81327408a5a33 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -4026,6 +4026,129 @@ class ChipClusters: }, }, } + _SMOKE_CO_ALARM_CLUSTER_INFO = { + "clusterName": "SmokeCoAlarm", + "clusterId": 0x0000005C, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "SelfTestRequest", + "args": { + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "ExpressedState", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "SmokeState", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "COState", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "BatteryAlert", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + }, + 0x00000004: { + "attributeName": "DeviceMuted", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, + 0x00000005: { + "attributeName": "TestInProgress", + "attributeId": 0x00000005, + "type": "bool", + "reportable": True, + }, + 0x00000006: { + "attributeName": "HardwareFaultAlert", + "attributeId": 0x00000006, + "type": "bool", + "reportable": True, + }, + 0x00000007: { + "attributeName": "EndOfServiceAlert", + "attributeId": 0x00000007, + "type": "int", + "reportable": True, + }, + 0x00000008: { + "attributeName": "InterconnectSmokeAlarm", + "attributeId": 0x00000008, + "type": "int", + "reportable": True, + }, + 0x00000009: { + "attributeName": "InterconnectCOAlarm", + "attributeId": 0x00000009, + "type": "int", + "reportable": True, + }, + 0x0000000A: { + "attributeName": "ContaminationState", + "attributeId": 0x0000000A, + "type": "int", + "reportable": True, + }, + 0x0000000B: { + "attributeName": "SensitivityLevel", + "attributeId": 0x0000000B, + "type": "int", + "reportable": True, + "writable": 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, @@ -10167,6 +10290,7 @@ class ChipClusters: 0x00000046: _ICD_MANAGEMENT_CLUSTER_INFO, 0x00000050: _MODE_SELECT_CLUSTER_INFO, 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, + 0x0000005C: _SMOKE_CO_ALARM_CLUSTER_INFO, 0x00000071: _HEPA_FILTER_MONITORING_CLUSTER_INFO, 0x00000072: _ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_INFO, 0x00000073: _CERAMIC_FILTER_MONITORING_CLUSTER_INFO, @@ -10249,6 +10373,7 @@ class ChipClusters: "IcdManagement": _ICD_MANAGEMENT_CLUSTER_INFO, "ModeSelect": _MODE_SELECT_CLUSTER_INFO, "AirQuality": _AIR_QUALITY_CLUSTER_INFO, + "SmokeCoAlarm": _SMOKE_CO_ALARM_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 dbcc7d61ff8e64..19eac70e7a158c 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -15262,6 +15262,609 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 +@dataclass +class SmokeCoAlarm(Cluster): + id: typing.ClassVar[int] = 0x005C + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="expressedState", Tag=0x00000000, Type=SmokeCoAlarm.Enums.ExpressedStateEnum), + ClusterObjectFieldDescriptor(Label="smokeState", Tag=0x00000001, Type=typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]), + ClusterObjectFieldDescriptor(Label="COState", Tag=0x00000002, Type=typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]), + ClusterObjectFieldDescriptor(Label="batteryAlert", Tag=0x00000003, Type=SmokeCoAlarm.Enums.AlarmStateEnum), + ClusterObjectFieldDescriptor(Label="deviceMuted", Tag=0x00000004, Type=typing.Optional[SmokeCoAlarm.Enums.MuteStateEnum]), + ClusterObjectFieldDescriptor(Label="testInProgress", Tag=0x00000005, Type=bool), + ClusterObjectFieldDescriptor(Label="hardwareFaultAlert", Tag=0x00000006, Type=bool), + ClusterObjectFieldDescriptor(Label="endOfServiceAlert", Tag=0x00000007, Type=SmokeCoAlarm.Enums.EndOfServiceEnum), + ClusterObjectFieldDescriptor(Label="interconnectSmokeAlarm", Tag=0x00000008, Type=typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]), + ClusterObjectFieldDescriptor(Label="interconnectCOAlarm", Tag=0x00000009, Type=typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]), + ClusterObjectFieldDescriptor(Label="contaminationState", Tag=0x0000000A, Type=typing.Optional[SmokeCoAlarm.Enums.ContaminationStateEnum]), + ClusterObjectFieldDescriptor(Label="sensitivityLevel", Tag=0x0000000B, Type=typing.Optional[SmokeCoAlarm.Enums.SensitivityEnum]), + 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), + ]) + + expressedState: 'SmokeCoAlarm.Enums.ExpressedStateEnum' = None + smokeState: 'typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]' = None + COState: 'typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]' = None + batteryAlert: 'SmokeCoAlarm.Enums.AlarmStateEnum' = None + deviceMuted: 'typing.Optional[SmokeCoAlarm.Enums.MuteStateEnum]' = None + testInProgress: 'bool' = None + hardwareFaultAlert: 'bool' = None + endOfServiceAlert: 'SmokeCoAlarm.Enums.EndOfServiceEnum' = None + interconnectSmokeAlarm: 'typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]' = None + interconnectCOAlarm: 'typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]' = None + contaminationState: 'typing.Optional[SmokeCoAlarm.Enums.ContaminationStateEnum]' = None + sensitivityLevel: 'typing.Optional[SmokeCoAlarm.Enums.SensitivityEnum]' = 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 AlarmStateEnum(MatterIntEnum): + kUnknown = 0x00 + kNormal = 0x01 + kWarning = 0x02 + kCritical = 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 ContaminationStateEnum(MatterIntEnum): + kUnknown = 0x00 + kNormal = 0x01 + kLow = 0x02 + kWarning = 0x03 + kCritical = 0x04 + # 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 = 5, + + class EndOfServiceEnum(MatterIntEnum): + kUnknown = 0x00 + kExpired = 0x01 + kNormal = 0x02 + # 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 = 3, + + class ExpressedStateEnum(MatterIntEnum): + kNormal = 0x00 + kSmokeAlarm = 0x01 + kCOAlarm = 0x02 + kBatteryAlert = 0x03 + kTesting = 0x04 + kHardwareFault = 0x05 + kEndOfService = 0x06 + kInterconnectSmoke = 0x07 + kInterconnectCO = 0x08 + # 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 = 9, + + class MuteStateEnum(MatterIntEnum): + kUnknown = 0x00 + kNotMuted = 0x01 + kMuted = 0x02 + # 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 = 3, + + class SensitivityEnum(MatterIntEnum): + kHigh = 0x00 + kStandard = 0x01 + kLow = 0x02 + # 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 = 3, + + class Bitmaps: + class SmokeCOAlarmFeature(IntFlag): + kSmokeAlarm = 0x1 + kCoAlarm = 0x2 + + class Commands: + @dataclass + class SelfTestRequest(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x005C + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + class Attributes: + @dataclass + class ExpressedState(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=SmokeCoAlarm.Enums.ExpressedStateEnum) + + value: 'SmokeCoAlarm.Enums.ExpressedStateEnum' = 0 + + @dataclass + class SmokeState(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]) + + value: 'typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]' = None + + @dataclass + class COState(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]) + + value: 'typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]' = None + + @dataclass + class BatteryAlert(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=SmokeCoAlarm.Enums.AlarmStateEnum) + + value: 'SmokeCoAlarm.Enums.AlarmStateEnum' = 0 + + @dataclass + class DeviceMuted(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[SmokeCoAlarm.Enums.MuteStateEnum]) + + value: 'typing.Optional[SmokeCoAlarm.Enums.MuteStateEnum]' = None + + @dataclass + class TestInProgress(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=bool) + + value: 'bool' = False + + @dataclass + class HardwareFaultAlert(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000006 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=bool) + + value: 'bool' = False + + @dataclass + class EndOfServiceAlert(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000007 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=SmokeCoAlarm.Enums.EndOfServiceEnum) + + value: 'SmokeCoAlarm.Enums.EndOfServiceEnum' = 0 + + @dataclass + class InterconnectSmokeAlarm(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000008 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]) + + value: 'typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]' = None + + @dataclass + class InterconnectCOAlarm(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000009 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]) + + value: 'typing.Optional[SmokeCoAlarm.Enums.AlarmStateEnum]' = None + + @dataclass + class ContaminationState(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000A + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[SmokeCoAlarm.Enums.ContaminationStateEnum]) + + value: 'typing.Optional[SmokeCoAlarm.Enums.ContaminationStateEnum]' = None + + @dataclass + class SensitivityLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000B + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[SmokeCoAlarm.Enums.SensitivityEnum]) + + value: 'typing.Optional[SmokeCoAlarm.Enums.SensitivityEnum]' = None + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @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 0x005C + + @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 0x005C + + @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 0x005C + + @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 0x005C + + @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 0x005C + + @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 SmokeAlarm(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class COAlarm(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class LowBattery(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class HardwareFault(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class EndOfService(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class SelfTestComplete(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class AlarmMuted(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000006 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class MuteEnded(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000007 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class InterconnectSmokeAlarm(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000008 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class InterconnectCOAlarm(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000009 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class AllClear(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x005C + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x0000000A + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass class HepaFilterMonitoring(Cluster): id: typing.ClassVar[int] = 0x0071 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 70f305e78f237b..365eb7462050e9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -8210,6 +8210,277 @@ static id _Nullable DecodeAttributeValueForAirQualityCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForSmokeCOAlarmCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::SmokeCoAlarm; + switch (aAttributeId) { + case Attributes::ExpressedState::Id: { + using TypeInfo = Attributes::ExpressedState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::SmokeState::Id: { + using TypeInfo = Attributes::SmokeState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::COState::Id: { + using TypeInfo = Attributes::COState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::BatteryAlert::Id: { + using TypeInfo = Attributes::BatteryAlert::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::DeviceMuted::Id: { + using TypeInfo = Attributes::DeviceMuted::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::TestInProgress::Id: { + using TypeInfo = Attributes::TestInProgress::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::HardwareFaultAlert::Id: { + using TypeInfo = Attributes::HardwareFaultAlert::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::EndOfServiceAlert::Id: { + using TypeInfo = Attributes::EndOfServiceAlert::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::InterconnectSmokeAlarm::Id: { + using TypeInfo = Attributes::InterconnectSmokeAlarm::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::InterconnectCOAlarm::Id: { + using TypeInfo = Attributes::InterconnectCOAlarm::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::ContaminationState::Id: { + using TypeInfo = Attributes::ContaminationState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::SensitivityLevel::Id: { + using TypeInfo = Attributes::SensitivityLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + 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) { @@ -19963,6 +20234,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::AirQuality::Id: { return DecodeAttributeValueForAirQualityCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::SmokeCoAlarm::Id: { + return DecodeAttributeValueForSmokeCOAlarmCluster(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 4cd60c44d3cd15..635b637054f74c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7527,6 +7527,253 @@ MTR_NEWLY_AVAILABLE @end +/** + * Cluster Smoke CO Alarm + * + * This cluster provides an interface for observing and managing the state of smoke and CO alarms. + */ +MTR_NEWLY_AVAILABLE +@interface MTRBaseClusterSmokeCOAlarm : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +/** + * Command SelfTestRequest + * + * This command SHALL initiate a device self-test. + */ +- (void)selfTestRequestWithParams:(MTRSmokeCOAlarmClusterSelfTestRequestParams * _Nullable)params + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; +- (void)selfTestRequestWithCompletion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeExpressedStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeExpressedStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeExpressedStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeSmokeStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeSmokeStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeSmokeStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeCOStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeCOStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeCOStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeBatteryAlertWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeBatteryAlertWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeBatteryAlertWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeDeviceMutedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeDeviceMutedWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeDeviceMutedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeTestInProgressWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeTestInProgressWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeTestInProgressWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeHardwareFaultAlertWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeHardwareFaultAlertWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeHardwareFaultAlertWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeEndOfServiceAlertWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeEndOfServiceAlertWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeEndOfServiceAlertWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeInterconnectSmokeAlarmWithCompletion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeInterconnectSmokeAlarmWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeInterconnectSmokeAlarmWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeInterconnectCOAlarmWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeInterconnectCOAlarmWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeInterconnectCOAlarmWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeContaminationStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeContaminationStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeContaminationStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeSensitivityLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)writeAttributeSensitivityLevelWithValue:(NSNumber * _Nonnull)value + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; +- (void)writeAttributeSensitivityLevelWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeSensitivityLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeSensitivityLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _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 * @@ -21858,6 +22105,56 @@ typedef NS_OPTIONS(uint32_t, MTRAirQualityFeature) { MTRAirQualityFeatureExtremelyPoor MTR_NEWLY_AVAILABLE = 0x8, } MTR_NEWLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRSmokeCOAlarmAlarmState) { + MTRSmokeCOAlarmAlarmStateUnknown MTR_NEWLY_AVAILABLE = 0x00, + MTRSmokeCOAlarmAlarmStateNormal MTR_NEWLY_AVAILABLE = 0x01, + MTRSmokeCOAlarmAlarmStateWarning MTR_NEWLY_AVAILABLE = 0x02, + MTRSmokeCOAlarmAlarmStateCritical MTR_NEWLY_AVAILABLE = 0x03, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRSmokeCOAlarmContaminationState) { + MTRSmokeCOAlarmContaminationStateUnknown MTR_NEWLY_AVAILABLE = 0x00, + MTRSmokeCOAlarmContaminationStateNormal MTR_NEWLY_AVAILABLE = 0x01, + MTRSmokeCOAlarmContaminationStateLow MTR_NEWLY_AVAILABLE = 0x02, + MTRSmokeCOAlarmContaminationStateWarning MTR_NEWLY_AVAILABLE = 0x03, + MTRSmokeCOAlarmContaminationStateCritical MTR_NEWLY_AVAILABLE = 0x04, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRSmokeCOAlarmEndOfService) { + MTRSmokeCOAlarmEndOfServiceUnknown MTR_NEWLY_AVAILABLE = 0x00, + MTRSmokeCOAlarmEndOfServiceExpired MTR_NEWLY_AVAILABLE = 0x01, + MTRSmokeCOAlarmEndOfServiceNormal MTR_NEWLY_AVAILABLE = 0x02, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRSmokeCOAlarmExpressedState) { + MTRSmokeCOAlarmExpressedStateNormal MTR_NEWLY_AVAILABLE = 0x00, + MTRSmokeCOAlarmExpressedStateSmokeAlarm MTR_NEWLY_AVAILABLE = 0x01, + MTRSmokeCOAlarmExpressedStateCOAlarm MTR_NEWLY_AVAILABLE = 0x02, + MTRSmokeCOAlarmExpressedStateBatteryAlert MTR_NEWLY_AVAILABLE = 0x03, + MTRSmokeCOAlarmExpressedStateTesting MTR_NEWLY_AVAILABLE = 0x04, + MTRSmokeCOAlarmExpressedStateHardwareFault MTR_NEWLY_AVAILABLE = 0x05, + MTRSmokeCOAlarmExpressedStateEndOfService MTR_NEWLY_AVAILABLE = 0x06, + MTRSmokeCOAlarmExpressedStateInterconnectSmoke MTR_NEWLY_AVAILABLE = 0x07, + MTRSmokeCOAlarmExpressedStateInterconnectCO MTR_NEWLY_AVAILABLE = 0x08, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRSmokeCOAlarmMuteState) { + MTRSmokeCOAlarmMuteStateUnknown MTR_NEWLY_AVAILABLE = 0x00, + MTRSmokeCOAlarmMuteStateNotMuted MTR_NEWLY_AVAILABLE = 0x01, + MTRSmokeCOAlarmMuteStateMuted MTR_NEWLY_AVAILABLE = 0x02, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRSmokeCOAlarmSensitivity) { + MTRSmokeCOAlarmSensitivityHigh MTR_NEWLY_AVAILABLE = 0x00, + MTRSmokeCOAlarmSensitivityStandard MTR_NEWLY_AVAILABLE = 0x01, + MTRSmokeCOAlarmSensitivityLow MTR_NEWLY_AVAILABLE = 0x02, +} MTR_NEWLY_AVAILABLE; + +typedef NS_OPTIONS(uint32_t, MTRSmokeCOAlarmFeature) { + MTRSmokeCOAlarmFeatureSmokeAlarm MTR_NEWLY_AVAILABLE = 0x1, + MTRSmokeCOAlarmFeatureCOAlarm MTR_NEWLY_AVAILABLE = 0x2, +} 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 e0f40b28570567..771c31f2c964df 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -46538,6 +46538,890 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterSmokeCOAlarm + +- (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)selfTestRequestWithCompletion:(MTRStatusCompletion)completion +{ + [self selfTestRequestWithParams:nil completion:completion]; +} +- (void)selfTestRequestWithParams:(MTRSmokeCOAlarmClusterSelfTestRequestParams * _Nullable)params + completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + SmokeCoAlarm::Commands::SelfTestRequest::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)readAttributeExpressedStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SmokeCoAlarm::Attributes::ExpressedState::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeExpressedStateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SmokeCoAlarm::Attributes::ExpressedState::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeExpressedStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmClusterExpressedStateEnumAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::Attributes::ExpressedState::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)readAttributeSmokeStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SmokeCoAlarm::Attributes::SmokeState::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeSmokeStateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SmokeCoAlarm::Attributes::SmokeState::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeSmokeStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmClusterAlarmStateEnumAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::Attributes::SmokeState::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)readAttributeCOStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SmokeCoAlarm::Attributes::COState::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeCOStateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SmokeCoAlarm::Attributes::COState::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeCOStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmClusterAlarmStateEnumAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::Attributes::COState::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)readAttributeBatteryAlertWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SmokeCoAlarm::Attributes::BatteryAlert::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeBatteryAlertWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SmokeCoAlarm::Attributes::BatteryAlert::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeBatteryAlertWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmClusterAlarmStateEnumAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::Attributes::BatteryAlert::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)readAttributeDeviceMutedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SmokeCoAlarm::Attributes::DeviceMuted::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeDeviceMutedWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SmokeCoAlarm::Attributes::DeviceMuted::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeDeviceMutedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmClusterMuteStateEnumAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::Attributes::DeviceMuted::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)readAttributeTestInProgressWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SmokeCoAlarm::Attributes::TestInProgress::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeTestInProgressWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SmokeCoAlarm::Attributes::TestInProgress::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeTestInProgressWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::Attributes::TestInProgress::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)readAttributeHardwareFaultAlertWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SmokeCoAlarm::Attributes::HardwareFaultAlert::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeHardwareFaultAlertWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SmokeCoAlarm::Attributes::HardwareFaultAlert::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeHardwareFaultAlertWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::Attributes::HardwareFaultAlert::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)readAttributeEndOfServiceAlertWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SmokeCoAlarm::Attributes::EndOfServiceAlert::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeEndOfServiceAlertWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SmokeCoAlarm::Attributes::EndOfServiceAlert::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeEndOfServiceAlertWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmClusterEndOfServiceEnumAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::Attributes::EndOfServiceAlert::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)readAttributeInterconnectSmokeAlarmWithCompletion:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SmokeCoAlarm::Attributes::InterconnectSmokeAlarm::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeInterconnectSmokeAlarmWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SmokeCoAlarm::Attributes::InterconnectSmokeAlarm::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeInterconnectSmokeAlarmWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion +{ + auto * bridge = new MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmClusterAlarmStateEnumAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::Attributes::InterconnectSmokeAlarm::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)readAttributeInterconnectCOAlarmWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SmokeCoAlarm::Attributes::InterconnectCOAlarm::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeInterconnectCOAlarmWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SmokeCoAlarm::Attributes::InterconnectCOAlarm::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeInterconnectCOAlarmWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmClusterAlarmStateEnumAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::Attributes::InterconnectCOAlarm::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)readAttributeContaminationStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SmokeCoAlarm::Attributes::ContaminationState::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeContaminationStateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SmokeCoAlarm::Attributes::ContaminationState::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeContaminationStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmClusterContaminationStateEnumAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::Attributes::ContaminationState::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)readAttributeSensitivityLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SmokeCoAlarm::Attributes::SensitivityLevel::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)writeAttributeSensitivityLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSensitivityLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSensitivityLevelWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completion(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = SmokeCoAlarm::Attributes::SensitivityLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedCharValue); + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSensitivityLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SmokeCoAlarm::Attributes::SensitivityLevel::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeSensitivityLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmClusterSensitivityEnumAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::Attributes::SensitivityLevel::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 = SmokeCoAlarm::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 = SmokeCoAlarm::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 MTRSmokeCOAlarmGeneratedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::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 = SmokeCoAlarm::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 = SmokeCoAlarm::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 MTRSmokeCOAlarmAcceptedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::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 = SmokeCoAlarm::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 = SmokeCoAlarm::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 MTRSmokeCOAlarmEventListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(SmokeCOAlarmEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::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 = SmokeCoAlarm::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 = SmokeCoAlarm::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 MTRSmokeCOAlarmAttributeListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SmokeCOAlarmAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SmokeCoAlarm::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 = SmokeCoAlarm::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 = SmokeCoAlarm::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 = SmokeCoAlarm::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 = SmokeCoAlarm::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 = SmokeCoAlarm::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 = SmokeCoAlarm::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 fb9bd379fd1b5f..56acf329bad4af 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -205,6 +205,11 @@ @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end +@interface MTRBaseClusterSmokeCOAlarm () +@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 d1da445d761ecb..789bb5d45a8245 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -384,6 +384,26 @@ typedef void (*NullableGroupKeyManagementClusterGroupKeySecurityPolicyEnumAttrib typedef void (*AirQualityClusterAirQualityEnumAttributeCallback)(void *, chip::app::Clusters::AirQuality::AirQualityEnum); typedef void (*NullableAirQualityClusterAirQualityEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); +typedef void (*SmokeCOAlarmClusterAlarmStateEnumAttributeCallback)(void *, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum); +typedef void (*NullableSmokeCOAlarmClusterAlarmStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*SmokeCOAlarmClusterContaminationStateEnumAttributeCallback)( + void *, chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum); +typedef void (*NullableSmokeCOAlarmClusterContaminationStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*SmokeCOAlarmClusterEndOfServiceEnumAttributeCallback)(void *, chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum); +typedef void (*NullableSmokeCOAlarmClusterEndOfServiceEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*SmokeCOAlarmClusterExpressedStateEnumAttributeCallback)(void *, + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum); +typedef void (*NullableSmokeCOAlarmClusterExpressedStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*SmokeCOAlarmClusterMuteStateEnumAttributeCallback)(void *, chip::app::Clusters::SmokeCoAlarm::MuteStateEnum); +typedef void (*NullableSmokeCOAlarmClusterMuteStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*SmokeCOAlarmClusterSensitivityEnumAttributeCallback)(void *, chip::app::Clusters::SmokeCoAlarm::SensitivityEnum); +typedef void (*NullableSmokeCOAlarmClusterSensitivityEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*HEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallback)( void *, chip::app::Clusters::HepaFilterMonitoring::ChangeIndicationEnum); typedef void (*NullableHEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallback)( @@ -999,6 +1019,14 @@ typedef void (*AirQualityAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*AirQualityAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*SmokeCOAlarmGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*SmokeCOAlarmAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*SmokeCOAlarmEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*SmokeCOAlarmAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); typedef void (*HEPAFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HEPAFilterMonitoringAcceptedCommandListListAttributeCallback)( @@ -7171,6 +7199,135 @@ class MTRAirQualityAttributeListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRSmokeCOAlarmGeneratedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSmokeCOAlarmGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSmokeCOAlarmGeneratedCommandListListAttributeCallbackBridge(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 MTRSmokeCOAlarmGeneratedCommandListListAttributeCallbackSubscriptionBridge + : public MTRSmokeCOAlarmGeneratedCommandListListAttributeCallbackBridge +{ +public: + MTRSmokeCOAlarmGeneratedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSmokeCOAlarmGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSmokeCOAlarmGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSmokeCOAlarmGeneratedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRSmokeCOAlarmAcceptedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSmokeCOAlarmAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSmokeCOAlarmAcceptedCommandListListAttributeCallbackBridge(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 MTRSmokeCOAlarmAcceptedCommandListListAttributeCallbackSubscriptionBridge + : public MTRSmokeCOAlarmAcceptedCommandListListAttributeCallbackBridge +{ +public: + MTRSmokeCOAlarmAcceptedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSmokeCOAlarmAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSmokeCOAlarmAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSmokeCOAlarmAcceptedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRSmokeCOAlarmEventListListAttributeCallbackBridge : public MTRCallbackBridge +{ +public: + MTRSmokeCOAlarmEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSmokeCOAlarmEventListListAttributeCallbackBridge(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 MTRSmokeCOAlarmEventListListAttributeCallbackSubscriptionBridge : public MTRSmokeCOAlarmEventListListAttributeCallbackBridge +{ +public: + MTRSmokeCOAlarmEventListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSmokeCOAlarmEventListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSmokeCOAlarmEventListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSmokeCOAlarmEventListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRSmokeCOAlarmAttributeListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSmokeCOAlarmAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSmokeCOAlarmAttributeListListAttributeCallbackBridge(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 MTRSmokeCOAlarmAttributeListListAttributeCallbackSubscriptionBridge + : public MTRSmokeCOAlarmAttributeListListAttributeCallbackBridge +{ +public: + MTRSmokeCOAlarmAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSmokeCOAlarmAttributeListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSmokeCOAlarmAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSmokeCOAlarmAttributeListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRHEPAFilterMonitoringGeneratedCommandListListAttributeCallbackBridge : public MTRCallbackBridge { @@ -17940,6 +18097,410 @@ class MTRNullableAirQualityClusterAirQualityEnumAttributeCallbackSubscriptionBri MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value); +}; + +class MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackSubscriptionBridge + : public MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge +{ +public: + MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRNullableSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge(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 MTRNullableSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge +{ +public: + MTRNullableSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value); +}; + +class MTRSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackSubscriptionBridge + : public MTRSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge +{ +public: + MTRSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRNullableSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge(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 MTRNullableSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge +{ +public: + MTRNullableSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value); +}; + +class MTRSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackSubscriptionBridge + : public MTRSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge +{ +public: + MTRSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRNullableSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge(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 MTRNullableSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackSubscriptionBridge + : public MTRNullableSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge +{ +public: + MTRNullableSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value); +}; + +class MTRSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackSubscriptionBridge + : public MTRSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge +{ +public: + MTRSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRNullableSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge(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 MTRNullableSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge +{ +public: + MTRNullableSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value); +}; + +class MTRSmokeCOAlarmClusterMuteStateEnumAttributeCallbackSubscriptionBridge + : public MTRSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge +{ +public: + MTRSmokeCOAlarmClusterMuteStateEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRNullableSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge(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 MTRNullableSmokeCOAlarmClusterMuteStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge +{ +public: + MTRNullableSmokeCOAlarmClusterMuteStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value); +}; + +class MTRSmokeCOAlarmClusterSensitivityEnumAttributeCallbackSubscriptionBridge + : public MTRSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge +{ +public: + MTRSmokeCOAlarmClusterSensitivityEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRNullableSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge(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 MTRNullableSmokeCOAlarmClusterSensitivityEnumAttributeCallbackSubscriptionBridge + : public MTRNullableSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge +{ +public: + MTRNullableSmokeCOAlarmClusterSensitivityEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge::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 ed52da96896ab1..0d1a057ee92423 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -6689,6 +6689,158 @@ } } +void MTRSmokeCOAlarmGeneratedCommandListListAttributeCallbackBridge::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 MTRSmokeCOAlarmGeneratedCommandListListAttributeCallbackSubscriptionBridge::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 MTRSmokeCOAlarmAcceptedCommandListListAttributeCallbackBridge::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 MTRSmokeCOAlarmAcceptedCommandListListAttributeCallbackSubscriptionBridge::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 MTRSmokeCOAlarmEventListListAttributeCallbackBridge::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 MTRSmokeCOAlarmEventListListAttributeCallbackSubscriptionBridge::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 MTRSmokeCOAlarmAttributeListListAttributeCallbackBridge::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 MTRSmokeCOAlarmAttributeListListAttributeCallbackSubscriptionBridge::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) { @@ -16851,6 +17003,306 @@ } } +void MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTRSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackSubscriptionBridge::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 MTRNullableSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackBridge::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 MTRNullableSmokeCOAlarmClusterAlarmStateEnumAttributeCallbackSubscriptionBridge::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 MTRSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTRSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackSubscriptionBridge::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 MTRNullableSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackBridge::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 MTRNullableSmokeCOAlarmClusterContaminationStateEnumAttributeCallbackSubscriptionBridge::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 MTRSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTRSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackSubscriptionBridge::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 MTRNullableSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackBridge::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 MTRNullableSmokeCOAlarmClusterEndOfServiceEnumAttributeCallbackSubscriptionBridge::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 MTRSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTRSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackSubscriptionBridge::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 MTRNullableSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackBridge::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 MTRNullableSmokeCOAlarmClusterExpressedStateEnumAttributeCallbackSubscriptionBridge::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 MTRSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTRSmokeCOAlarmClusterMuteStateEnumAttributeCallbackSubscriptionBridge::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 MTRNullableSmokeCOAlarmClusterMuteStateEnumAttributeCallbackBridge::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 MTRNullableSmokeCOAlarmClusterMuteStateEnumAttributeCallbackSubscriptionBridge::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 MTRSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTRSmokeCOAlarmClusterSensitivityEnumAttributeCallbackSubscriptionBridge::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 MTRNullableSmokeCOAlarmClusterSensitivityEnumAttributeCallbackBridge::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 MTRNullableSmokeCOAlarmClusterSensitivityEnumAttributeCallbackSubscriptionBridge::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 09180049b086b2..f622d1fc0585b7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -277,6 +277,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeBooleanStateID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000045, MTRClusterIDTypeModeSelectID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000050, MTRClusterIDTypeAirQualityID MTR_NEWLY_AVAILABLE = 0x0000005B, + MTRClusterIDTypeSmokeCOAlarmID MTR_NEWLY_AVAILABLE = 0x0000005C, MTRClusterIDTypeHEPAFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000071, MTRClusterIDTypeActivatedCarbonFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000072, MTRClusterIDTypeCeramicFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000073, @@ -3673,6 +3674,29 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterAirQualityAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster SmokeCOAlarm attributes + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeExpressedStateID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeSmokeStateID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeCOStateID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeBatteryAlertID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeDeviceMutedID MTR_NEWLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeTestInProgressID MTR_NEWLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeHardwareFaultAlertID MTR_NEWLY_AVAILABLE = 0x00000006, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeEndOfServiceAlertID MTR_NEWLY_AVAILABLE = 0x00000007, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeInterconnectSmokeAlarmID MTR_NEWLY_AVAILABLE = 0x00000008, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeInterconnectCOAlarmID MTR_NEWLY_AVAILABLE = 0x00000009, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeContaminationStateID MTR_NEWLY_AVAILABLE = 0x0000000A, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeSensitivityLevelID MTR_NEWLY_AVAILABLE = 0x0000000B, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeAttributeListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeFeatureMapID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterSmokeCOAlarmAttributeClusterRevisionID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster HEPAFilterMonitoring attributes MTRAttributeIDTypeClusterHEPAFilterMonitoringAttributeConditionID MTR_NEWLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterHEPAFilterMonitoringAttributeDegradationDirectionID MTR_NEWLY_AVAILABLE = 0x00000001, @@ -8951,6 +8975,9 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterModeSelectCommandChangeToModeID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000000, + // Cluster SmokeCOAlarm commands + MTRCommandIDTypeClusterSmokeCOAlarmCommandSelfTestRequestID MTR_NEWLY_AVAILABLE = 0x00000000, + // Cluster HEPAFilterMonitoring commands MTRCommandIDTypeClusterHEPAFilterMonitoringCommandResetConditionID MTR_NEWLY_AVAILABLE = 0x00000000, @@ -10105,6 +10132,19 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterBooleanStateEventStateChangeID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000000, + // Cluster SmokeCOAlarm events + MTREventIDTypeClusterSmokeCOAlarmEventSmokeAlarmID MTR_NEWLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterSmokeCOAlarmEventCOAlarmID MTR_NEWLY_AVAILABLE = 0x00000001, + MTREventIDTypeClusterSmokeCOAlarmEventLowBatteryID MTR_NEWLY_AVAILABLE = 0x00000002, + MTREventIDTypeClusterSmokeCOAlarmEventHardwareFaultID MTR_NEWLY_AVAILABLE = 0x00000003, + MTREventIDTypeClusterSmokeCOAlarmEventEndOfServiceID MTR_NEWLY_AVAILABLE = 0x00000004, + MTREventIDTypeClusterSmokeCOAlarmEventSelfTestCompleteID MTR_NEWLY_AVAILABLE = 0x00000005, + MTREventIDTypeClusterSmokeCOAlarmEventAlarmMutedID MTR_NEWLY_AVAILABLE = 0x00000006, + MTREventIDTypeClusterSmokeCOAlarmEventMuteEndedID MTR_NEWLY_AVAILABLE = 0x00000007, + MTREventIDTypeClusterSmokeCOAlarmEventInterconnectSmokeAlarmID MTR_NEWLY_AVAILABLE = 0x00000008, + MTREventIDTypeClusterSmokeCOAlarmEventInterconnectCOAlarmID MTR_NEWLY_AVAILABLE = 0x00000009, + MTREventIDTypeClusterSmokeCOAlarmEventAllClearID MTR_NEWLY_AVAILABLE = 0x0000000A, + // 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 c76c2ee18d734c..7370fb9803a590 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -2750,6 +2750,70 @@ MTR_NEWLY_AVAILABLE @end +/** + * Cluster Smoke CO Alarm + * This cluster provides an interface for observing and managing the state of smoke and CO alarms. + */ +MTR_NEWLY_AVAILABLE +@interface MTRClusterSmokeCOAlarm : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +- (void)selfTestRequestWithParams:(MTRSmokeCOAlarmClusterSelfTestRequestParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; +- (void)selfTestRequestWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeExpressedStateWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeSmokeStateWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeCOStateWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeBatteryAlertWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeDeviceMutedWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeTestInProgressWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeHardwareFaultAlertWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeEndOfServiceAlertWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeInterconnectSmokeAlarmWithParams:(MTRReadParams * _Nullable)params + MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeInterconnectCOAlarmWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeContaminationStateWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeSensitivityLevelWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; +- (void)writeAttributeSensitivityLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_NEWLY_AVAILABLE; +- (void)writeAttributeSensitivityLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(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 ef4792e1b86a0a..f3cd954bc3acfe 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -12714,6 +12714,254 @@ - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpoi @end +@implementation MTRClusterSmokeCOAlarm + +- (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)selfTestRequestWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion +{ + [self selfTestRequestWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completion:completion]; +} +- (void)selfTestRequestWithParams:(MTRSmokeCOAlarmClusterSelfTestRequestParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeSmokeCOAlarmID, + (unsigned int) MTRCommandIDTypeClusterSmokeCOAlarmCommandSelfTestRequestID]; + // 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 MTRCommandSuccessCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + SmokeCoAlarm::Commands::SelfTestRequest::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 *)readAttributeExpressedStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeExpressedStateID) + params:params]; +} + +- (NSDictionary *)readAttributeSmokeStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeSmokeStateID) + params:params]; +} + +- (NSDictionary *)readAttributeCOStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeCOStateID) + params:params]; +} + +- (NSDictionary *)readAttributeBatteryAlertWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeBatteryAlertID) + params:params]; +} + +- (NSDictionary *)readAttributeDeviceMutedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeDeviceMutedID) + params:params]; +} + +- (NSDictionary *)readAttributeTestInProgressWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeTestInProgressID) + params:params]; +} + +- (NSDictionary *)readAttributeHardwareFaultAlertWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeHardwareFaultAlertID) + params:params]; +} + +- (NSDictionary *)readAttributeEndOfServiceAlertWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeEndOfServiceAlertID) + params:params]; +} + +- (NSDictionary *)readAttributeInterconnectSmokeAlarmWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeInterconnectSmokeAlarmID) + params:params]; +} + +- (NSDictionary *)readAttributeInterconnectCOAlarmWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeInterconnectCOAlarmID) + params:params]; +} + +- (NSDictionary *)readAttributeContaminationStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeContaminationStateID) + params:params]; +} + +- (NSDictionary *)readAttributeSensitivityLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeSensitivityLevelID) + params:params]; +} + +- (void)writeAttributeSensitivityLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSensitivityLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSensitivityLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeSensitivityLevelID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) + attributeID:@(MTRAttributeIDTypeClusterSmokeCOAlarmAttributeClusterRevisionID) + 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 62f9e11b8a2f0d..d0cc71a08709c4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -206,6 +206,11 @@ @property (nonatomic, readonly) MTRDevice * device; @end +@interface MTRClusterSmokeCOAlarm () +@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 56915dd4293c74..861bbc51fe8b42 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -4077,6 +4077,34 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_NEWLY_AVAILABLE +@interface MTRSmokeCOAlarmClusterSelfTestRequestParams : 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 MTRHEPAFilterMonitoringClusterResetConditionParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 9e7af8854b0c15..daf32a359e364e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -6458,6 +6458,33 @@ - (NSString *)description return descriptionString; } +@end +@implementation MTRSmokeCOAlarmClusterSelfTestRequestParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRSmokeCOAlarmClusterSelfTestRequestParams 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 MTRHEPAFilterMonitoringClusterResetConditionParams - (instancetype)init diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index c2f6412ab9a110..4453da496c6f90 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1563,6 +1563,139 @@ static id _Nullable DecodeEventPayloadForAirQualityCluster(EventId aEventId, TLV *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForSmokeCOAlarmCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::SmokeCoAlarm; + switch (aEventId) { + case Events::SmokeAlarm::Id: { + Events::SmokeAlarm::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRSmokeCOAlarmClusterSmokeAlarmEvent new]; + + return value; + } + case Events::COAlarm::Id: { + Events::COAlarm::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRSmokeCOAlarmClusterCOAlarmEvent new]; + + return value; + } + case Events::LowBattery::Id: { + Events::LowBattery::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRSmokeCOAlarmClusterLowBatteryEvent new]; + + return value; + } + case Events::HardwareFault::Id: { + Events::HardwareFault::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRSmokeCOAlarmClusterHardwareFaultEvent new]; + + return value; + } + case Events::EndOfService::Id: { + Events::EndOfService::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRSmokeCOAlarmClusterEndOfServiceEvent new]; + + return value; + } + case Events::SelfTestComplete::Id: { + Events::SelfTestComplete::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRSmokeCOAlarmClusterSelfTestCompleteEvent new]; + + return value; + } + case Events::AlarmMuted::Id: { + Events::AlarmMuted::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRSmokeCOAlarmClusterAlarmMutedEvent new]; + + return value; + } + case Events::MuteEnded::Id: { + Events::MuteEnded::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRSmokeCOAlarmClusterMuteEndedEvent new]; + + return value; + } + case Events::InterconnectSmokeAlarm::Id: { + Events::InterconnectSmokeAlarm::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRSmokeCOAlarmClusterInterconnectSmokeAlarmEvent new]; + + return value; + } + case Events::InterconnectCOAlarm::Id: { + Events::InterconnectCOAlarm::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRSmokeCOAlarmClusterInterconnectCOAlarmEvent new]; + + return value; + } + case Events::AllClear::Id: { + Events::AllClear::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRSmokeCOAlarmClusterAllClearEvent new]; + + 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) { @@ -2744,6 +2877,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::AirQuality::Id: { return DecodeEventPayloadForAirQualityCluster(aPath.mEventId, aReader, aError); } + case Clusters::SmokeCoAlarm::Id: { + return DecodeEventPayloadForSmokeCOAlarmCluster(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 e03820f9925bc1..69f55412ecf92b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -679,6 +679,50 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy) NSArray * _Nonnull semanticTags API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @end +MTR_NEWLY_AVAILABLE +@interface MTRSmokeCOAlarmClusterSmokeAlarmEvent : NSObject +@end + +MTR_NEWLY_AVAILABLE +@interface MTRSmokeCOAlarmClusterCOAlarmEvent : NSObject +@end + +MTR_NEWLY_AVAILABLE +@interface MTRSmokeCOAlarmClusterLowBatteryEvent : NSObject +@end + +MTR_NEWLY_AVAILABLE +@interface MTRSmokeCOAlarmClusterHardwareFaultEvent : NSObject +@end + +MTR_NEWLY_AVAILABLE +@interface MTRSmokeCOAlarmClusterEndOfServiceEvent : NSObject +@end + +MTR_NEWLY_AVAILABLE +@interface MTRSmokeCOAlarmClusterSelfTestCompleteEvent : NSObject +@end + +MTR_NEWLY_AVAILABLE +@interface MTRSmokeCOAlarmClusterAlarmMutedEvent : NSObject +@end + +MTR_NEWLY_AVAILABLE +@interface MTRSmokeCOAlarmClusterMuteEndedEvent : NSObject +@end + +MTR_NEWLY_AVAILABLE +@interface MTRSmokeCOAlarmClusterInterconnectSmokeAlarmEvent : NSObject +@end + +MTR_NEWLY_AVAILABLE +@interface MTRSmokeCOAlarmClusterInterconnectCOAlarmEvent : NSObject +@end + +MTR_NEWLY_AVAILABLE +@interface MTRSmokeCOAlarmClusterAllClearEvent : NSObject +@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 bc26064a203a12..bece6deb1aca31 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -2667,6 +2667,259 @@ - (NSString *)description @end +@implementation MTRSmokeCOAlarmClusterSmokeAlarmEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRSmokeCOAlarmClusterSmokeAlarmEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRSmokeCOAlarmClusterCOAlarmEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRSmokeCOAlarmClusterCOAlarmEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRSmokeCOAlarmClusterLowBatteryEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRSmokeCOAlarmClusterLowBatteryEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRSmokeCOAlarmClusterHardwareFaultEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRSmokeCOAlarmClusterHardwareFaultEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRSmokeCOAlarmClusterEndOfServiceEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRSmokeCOAlarmClusterEndOfServiceEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRSmokeCOAlarmClusterSelfTestCompleteEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRSmokeCOAlarmClusterSelfTestCompleteEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRSmokeCOAlarmClusterAlarmMutedEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRSmokeCOAlarmClusterAlarmMutedEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRSmokeCOAlarmClusterMuteEndedEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRSmokeCOAlarmClusterMuteEndedEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRSmokeCOAlarmClusterInterconnectSmokeAlarmEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRSmokeCOAlarmClusterInterconnectSmokeAlarmEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRSmokeCOAlarmClusterInterconnectCOAlarmEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRSmokeCOAlarmClusterInterconnectCOAlarmEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRSmokeCOAlarmClusterAllClearEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRSmokeCOAlarmClusterAllClearEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + 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 fcab59c1d2814c..157a420c1b486e 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 @@ -7309,6 +7309,446 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace AirQuality +namespace SmokeCoAlarm { +namespace Attributes { + +namespace ExpressedState { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::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, chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum 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::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace ExpressedState + +namespace SmokeState { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::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, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum 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::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace SmokeState + +namespace COState { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::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, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum 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::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace COState + +namespace BatteryAlert { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::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, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum 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::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace BatteryAlert + +namespace DeviceMuted { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::MuteStateEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::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, chip::app::Clusters::SmokeCoAlarm::MuteStateEnum 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::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace DeviceMuted + +namespace TestInProgress { + +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::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, bool 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::SmokeCoAlarm::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace TestInProgress + +namespace HardwareFaultAlert { + +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::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, bool 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::SmokeCoAlarm::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace HardwareFaultAlert + +namespace EndOfServiceAlert { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::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, chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum 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::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace EndOfServiceAlert + +namespace InterconnectSmokeAlarm { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::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, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum 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::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace InterconnectSmokeAlarm + +namespace InterconnectCOAlarm { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::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, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum 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::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace InterconnectCOAlarm + +namespace ContaminationState { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::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, chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum 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::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace ContaminationState + +namespace SensitivityLevel { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::SensitivityEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::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, chip::app::Clusters::SmokeCoAlarm::SensitivityEnum 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::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace SensitivityLevel + +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::SmokeCoAlarm::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::SmokeCoAlarm::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::SmokeCoAlarm::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::SmokeCoAlarm::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace SmokeCoAlarm + 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 9faa978c32e8c7..c2bd2cc2c5f3f2 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 @@ -1402,6 +1402,83 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace AirQuality +namespace SmokeCoAlarm { +namespace Attributes { + +namespace ExpressedState { +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum * value); // ExpressedStateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value); +} // namespace ExpressedState + +namespace SmokeState { +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value); // AlarmStateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value); +} // namespace SmokeState + +namespace COState { +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value); // AlarmStateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value); +} // namespace COState + +namespace BatteryAlert { +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value); // AlarmStateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value); +} // namespace BatteryAlert + +namespace DeviceMuted { +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::MuteStateEnum * value); // MuteStateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value); +} // namespace DeviceMuted + +namespace TestInProgress { +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); +} // namespace TestInProgress + +namespace HardwareFaultAlert { +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); +} // namespace HardwareFaultAlert + +namespace EndOfServiceAlert { +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum * value); // EndOfServiceEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value); +} // namespace EndOfServiceAlert + +namespace InterconnectSmokeAlarm { +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value); // AlarmStateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value); +} // namespace InterconnectSmokeAlarm + +namespace InterconnectCOAlarm { +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value); // AlarmStateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value); +} // namespace InterconnectCOAlarm + +namespace ContaminationState { +EmberAfStatus Get(chip::EndpointId endpoint, + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum * value); // ContaminationStateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value); +} // namespace ContaminationState + +namespace SensitivityLevel { +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::SensitivityEnum * value); // SensitivityEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value); +} // namespace SensitivityLevel + +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 SmokeCoAlarm + 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 087234106a8474..60867c798cb930 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -377,6 +377,14 @@ void emberAfModeSelectClusterInitCallback(chip::EndpointId endpoint); */ void emberAfAirQualityClusterInitCallback(chip::EndpointId endpoint); +/** @brief Smoke CO Alarm Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfSmokeCoAlarmClusterInitCallback(chip::EndpointId endpoint); + /** @brief HEPA Filter Monitoring Cluster Init * * Cluster Init @@ -4030,6 +4038,84 @@ void emberAfAirQualityClusterServerTickCallback(chip::EndpointId endpoint); */ void emberAfAirQualityClusterClientTickCallback(chip::EndpointId endpoint); +// +// Smoke CO Alarm Cluster +// + +/** @brief Smoke CO Alarm Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfSmokeCoAlarmClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Smoke CO Alarm Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterSmokeCoAlarmClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief Smoke CO Alarm Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfSmokeCoAlarmClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Smoke CO Alarm Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterSmokeCoAlarmClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Smoke CO Alarm 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 +MatterSmokeCoAlarmClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Smoke CO Alarm 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 +MatterSmokeCoAlarmClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Smoke CO Alarm Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfSmokeCoAlarmClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Smoke CO Alarm Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfSmokeCoAlarmClusterClientTickCallback(chip::EndpointId endpoint); + // // HEPA Filter Monitoring Cluster // @@ -7764,6 +7850,12 @@ bool emberAfIcdManagementClusterStayActiveRequestCallback( bool emberAfModeSelectClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ModeSelect::Commands::ChangeToMode::DecodableType & commandData); +/** + * @brief Smoke CO Alarm Cluster SelfTestRequest Command callback (from client) + */ +bool emberAfSmokeCoAlarmClusterSelfTestRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::SmokeCoAlarm::Commands::SelfTestRequest::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 0c719c6b360e1c..743413fd66a4f3 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 @@ -1302,6 +1302,94 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(AirQuality::AirQualityE } } +static auto __attribute__((unused)) EnsureKnownEnumValue(SmokeCoAlarm::AlarmStateEnum val) +{ + using EnumType = SmokeCoAlarm::AlarmStateEnum; + switch (val) + { + case EnumType::kUnknown: + case EnumType::kNormal: + case EnumType::kWarning: + case EnumType::kCritical: + return val; + default: + return static_cast(4); + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(SmokeCoAlarm::ContaminationStateEnum val) +{ + using EnumType = SmokeCoAlarm::ContaminationStateEnum; + switch (val) + { + case EnumType::kUnknown: + case EnumType::kNormal: + case EnumType::kLow: + case EnumType::kWarning: + case EnumType::kCritical: + return val; + default: + return static_cast(5); + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(SmokeCoAlarm::EndOfServiceEnum val) +{ + using EnumType = SmokeCoAlarm::EndOfServiceEnum; + switch (val) + { + case EnumType::kUnknown: + case EnumType::kExpired: + case EnumType::kNormal: + return val; + default: + return static_cast(3); + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(SmokeCoAlarm::ExpressedStateEnum val) +{ + using EnumType = SmokeCoAlarm::ExpressedStateEnum; + switch (val) + { + case EnumType::kNormal: + case EnumType::kSmokeAlarm: + case EnumType::kCOAlarm: + case EnumType::kBatteryAlert: + case EnumType::kTesting: + case EnumType::kHardwareFault: + case EnumType::kEndOfService: + case EnumType::kInterconnectSmoke: + case EnumType::kInterconnectCO: + return val; + default: + return static_cast(9); + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(SmokeCoAlarm::MuteStateEnum val) +{ + using EnumType = SmokeCoAlarm::MuteStateEnum; + switch (val) + { + case EnumType::kUnknown: + case EnumType::kNotMuted: + case EnumType::kMuted: + return val; + default: + return static_cast(3); + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(SmokeCoAlarm::SensitivityEnum val) +{ + using EnumType = SmokeCoAlarm::SensitivityEnum; + switch (val) + { + case EnumType::kHigh: + case EnumType::kStandard: + case EnumType::kLow: + return val; + default: + return static_cast(3); + } +} + 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 246b5a69dbff80..e442811a9d543e 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 @@ -1533,6 +1533,103 @@ enum class Feature : uint32_t }; } // namespace AirQuality +namespace SmokeCoAlarm { + +// Enum for AlarmStateEnum +enum class AlarmStateEnum : uint8_t +{ + kUnknown = 0x00, + kNormal = 0x01, + kWarning = 0x02, + kCritical = 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 ContaminationStateEnum +enum class ContaminationStateEnum : uint8_t +{ + kUnknown = 0x00, + kNormal = 0x01, + kLow = 0x02, + kWarning = 0x03, + kCritical = 0x04, + // 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 = 5, +}; + +// Enum for EndOfServiceEnum +enum class EndOfServiceEnum : uint8_t +{ + kUnknown = 0x00, + kExpired = 0x01, + kNormal = 0x02, + // 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 = 3, +}; + +// Enum for ExpressedStateEnum +enum class ExpressedStateEnum : uint8_t +{ + kNormal = 0x00, + kSmokeAlarm = 0x01, + kCOAlarm = 0x02, + kBatteryAlert = 0x03, + kTesting = 0x04, + kHardwareFault = 0x05, + kEndOfService = 0x06, + kInterconnectSmoke = 0x07, + kInterconnectCO = 0x08, + // 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 = 9, +}; + +// Enum for MuteStateEnum +enum class MuteStateEnum : uint8_t +{ + kUnknown = 0x00, + kNotMuted = 0x01, + kMuted = 0x02, + // 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 = 3, +}; + +// Enum for SensitivityEnum +enum class SensitivityEnum : uint8_t +{ + kHigh = 0x00, + kStandard = 0x01, + kLow = 0x02, + // 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 = 3, +}; + +// Bitmap for SmokeCOAlarmFeature +enum class SmokeCOAlarmFeature : uint32_t +{ + kSmokeAlarm = 0x1, + kCoAlarm = 0x2, +}; +} // namespace SmokeCoAlarm + 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 04d41b66fcd63e..dca74178b8717d 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 @@ -11465,6 +11465,478 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace AirQuality +namespace SmokeCoAlarm { + +namespace Commands { +namespace SelfTestRequest { +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 SelfTestRequest. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::ExpressedState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, expressedState)); + break; + case Attributes::SmokeState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, smokeState)); + break; + case Attributes::COState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, COState)); + break; + case Attributes::BatteryAlert::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, batteryAlert)); + break; + case Attributes::DeviceMuted::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, deviceMuted)); + break; + case Attributes::TestInProgress::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, testInProgress)); + break; + case Attributes::HardwareFaultAlert::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, hardwareFaultAlert)); + break; + case Attributes::EndOfServiceAlert::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, endOfServiceAlert)); + break; + case Attributes::InterconnectSmokeAlarm::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, interconnectSmokeAlarm)); + break; + case Attributes::InterconnectCOAlarm::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, interconnectCOAlarm)); + break; + case Attributes::ContaminationState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, contaminationState)); + break; + case Attributes::SensitivityLevel::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, sensitivityLevel)); + 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 SmokeAlarm { +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 SmokeAlarm. +namespace COAlarm { +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 COAlarm. +namespace LowBattery { +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 LowBattery. +namespace HardwareFault { +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 HardwareFault. +namespace EndOfService { +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 EndOfService. +namespace SelfTestComplete { +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 SelfTestComplete. +namespace AlarmMuted { +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 AlarmMuted. +namespace MuteEnded { +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 MuteEnded. +namespace InterconnectSmokeAlarm { +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 InterconnectSmokeAlarm. +namespace InterconnectCOAlarm { +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 InterconnectCOAlarm. +namespace AllClear { +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 AllClear. +} // namespace Events + +} // namespace SmokeCoAlarm namespace HepaFilterMonitoring { namespace Commands { @@ -23369,6 +23841,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::SmokeCoAlarm::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 703cec6ef621c1..f5e8abac2dabcd 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 @@ -14287,6 +14287,581 @@ struct TypeInfo }; } // namespace Attributes } // namespace AirQuality +namespace SmokeCoAlarm { + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace SelfTestRequest { +struct Type; +struct DecodableType; +} // namespace SelfTestRequest + +} // namespace Commands + +namespace Commands { +namespace SelfTestRequest { +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::SelfTestRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + 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::SelfTestRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SelfTestRequest +} // namespace Commands + +namespace Attributes { + +namespace ExpressedState { +struct TypeInfo +{ + using Type = chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum; + using DecodableType = chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum; + using DecodableArgType = chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ExpressedState::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ExpressedState +namespace SmokeState { +struct TypeInfo +{ + using Type = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + using DecodableType = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + using DecodableArgType = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SmokeState::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SmokeState +namespace COState { +struct TypeInfo +{ + using Type = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + using DecodableType = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + using DecodableArgType = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::COState::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace COState +namespace BatteryAlert { +struct TypeInfo +{ + using Type = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + using DecodableType = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + using DecodableArgType = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::BatteryAlert::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace BatteryAlert +namespace DeviceMuted { +struct TypeInfo +{ + using Type = chip::app::Clusters::SmokeCoAlarm::MuteStateEnum; + using DecodableType = chip::app::Clusters::SmokeCoAlarm::MuteStateEnum; + using DecodableArgType = chip::app::Clusters::SmokeCoAlarm::MuteStateEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::DeviceMuted::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace DeviceMuted +namespace TestInProgress { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::TestInProgress::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace TestInProgress +namespace HardwareFaultAlert { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::HardwareFaultAlert::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace HardwareFaultAlert +namespace EndOfServiceAlert { +struct TypeInfo +{ + using Type = chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum; + using DecodableType = chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum; + using DecodableArgType = chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::EndOfServiceAlert::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace EndOfServiceAlert +namespace InterconnectSmokeAlarm { +struct TypeInfo +{ + using Type = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + using DecodableType = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + using DecodableArgType = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::InterconnectSmokeAlarm::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace InterconnectSmokeAlarm +namespace InterconnectCOAlarm { +struct TypeInfo +{ + using Type = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + using DecodableType = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + using DecodableArgType = chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::InterconnectCOAlarm::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace InterconnectCOAlarm +namespace ContaminationState { +struct TypeInfo +{ + using Type = chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum; + using DecodableType = chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum; + using DecodableArgType = chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ContaminationState::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ContaminationState +namespace SensitivityLevel { +struct TypeInfo +{ + using Type = chip::app::Clusters::SmokeCoAlarm::SensitivityEnum; + using DecodableType = chip::app::Clusters::SmokeCoAlarm::SensitivityEnum; + using DecodableArgType = chip::app::Clusters::SmokeCoAlarm::SensitivityEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SensitivityLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SensitivityLevel +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::ExpressedState::TypeInfo::DecodableType expressedState = + static_cast(0); + Attributes::SmokeState::TypeInfo::DecodableType smokeState = + static_cast(0); + Attributes::COState::TypeInfo::DecodableType COState = static_cast(0); + Attributes::BatteryAlert::TypeInfo::DecodableType batteryAlert = + static_cast(0); + Attributes::DeviceMuted::TypeInfo::DecodableType deviceMuted = + static_cast(0); + Attributes::TestInProgress::TypeInfo::DecodableType testInProgress = static_cast(0); + Attributes::HardwareFaultAlert::TypeInfo::DecodableType hardwareFaultAlert = static_cast(0); + Attributes::EndOfServiceAlert::TypeInfo::DecodableType endOfServiceAlert = + static_cast(0); + Attributes::InterconnectSmokeAlarm::TypeInfo::DecodableType interconnectSmokeAlarm = + static_cast(0); + Attributes::InterconnectCOAlarm::TypeInfo::DecodableType interconnectCOAlarm = + static_cast(0); + Attributes::ContaminationState::TypeInfo::DecodableType contaminationState = + static_cast(0); + Attributes::SensitivityLevel::TypeInfo::DecodableType sensitivityLevel = + static_cast(0); + 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 SmokeAlarm { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::SmokeAlarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr bool kIsFabricScoped = false; + + 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::SmokeAlarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace SmokeAlarm +namespace COAlarm { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::COAlarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr bool kIsFabricScoped = false; + + 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::COAlarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace COAlarm +namespace LowBattery { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::LowBattery::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr bool kIsFabricScoped = false; + + 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::LowBattery::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace LowBattery +namespace HardwareFault { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::HardwareFault::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr bool kIsFabricScoped = false; + + 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::HardwareFault::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace HardwareFault +namespace EndOfService { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::EndOfService::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr bool kIsFabricScoped = false; + + 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::EndOfService::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace EndOfService +namespace SelfTestComplete { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::SelfTestComplete::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr bool kIsFabricScoped = false; + + 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::SelfTestComplete::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace SelfTestComplete +namespace AlarmMuted { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::AlarmMuted::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr bool kIsFabricScoped = false; + + 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::AlarmMuted::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace AlarmMuted +namespace MuteEnded { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::MuteEnded::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr bool kIsFabricScoped = false; + + 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::MuteEnded::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace MuteEnded +namespace InterconnectSmokeAlarm { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::InterconnectSmokeAlarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr bool kIsFabricScoped = false; + + 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::InterconnectSmokeAlarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace InterconnectSmokeAlarm +namespace InterconnectCOAlarm { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::InterconnectCOAlarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr bool kIsFabricScoped = false; + + 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::InterconnectCOAlarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace InterconnectCOAlarm +namespace AllClear { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::AllClear::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + static constexpr bool kIsFabricScoped = false; + + 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::AllClear::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SmokeCoAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace AllClear +} // namespace Events +} // namespace SmokeCoAlarm 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 282b181c00dbac..23195b27c6a2e5 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 @@ -2493,6 +2493,84 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace AirQuality +namespace SmokeCoAlarm { +namespace Attributes { + +namespace ExpressedState { +static constexpr AttributeId Id = 0x00000000; +} // namespace ExpressedState + +namespace SmokeState { +static constexpr AttributeId Id = 0x00000001; +} // namespace SmokeState + +namespace COState { +static constexpr AttributeId Id = 0x00000002; +} // namespace COState + +namespace BatteryAlert { +static constexpr AttributeId Id = 0x00000003; +} // namespace BatteryAlert + +namespace DeviceMuted { +static constexpr AttributeId Id = 0x00000004; +} // namespace DeviceMuted + +namespace TestInProgress { +static constexpr AttributeId Id = 0x00000005; +} // namespace TestInProgress + +namespace HardwareFaultAlert { +static constexpr AttributeId Id = 0x00000006; +} // namespace HardwareFaultAlert + +namespace EndOfServiceAlert { +static constexpr AttributeId Id = 0x00000007; +} // namespace EndOfServiceAlert + +namespace InterconnectSmokeAlarm { +static constexpr AttributeId Id = 0x00000008; +} // namespace InterconnectSmokeAlarm + +namespace InterconnectCOAlarm { +static constexpr AttributeId Id = 0x00000009; +} // namespace InterconnectCOAlarm + +namespace ContaminationState { +static constexpr AttributeId Id = 0x0000000A; +} // namespace ContaminationState + +namespace SensitivityLevel { +static constexpr AttributeId Id = 0x0000000B; +} // namespace SensitivityLevel + +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 SmokeCoAlarm + 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 fc795276405b35..04e6bac99a7bb4 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 @@ -154,6 +154,9 @@ static constexpr ClusterId Id = 0x00000050; namespace AirQuality { static constexpr ClusterId Id = 0x0000005B; } // namespace AirQuality +namespace SmokeCoAlarm { +static constexpr ClusterId Id = 0x0000005C; +} // namespace SmokeCoAlarm 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 1d97415c764c37..351e551af9b10a 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 @@ -641,6 +641,16 @@ static constexpr CommandId Id = 0x00000000; } // namespace Commands } // namespace ModeSelect +namespace SmokeCoAlarm { +namespace Commands { + +namespace SelfTestRequest { +static constexpr CommandId Id = 0x00000000; +} // namespace SelfTestRequest + +} // namespace Commands +} // namespace SmokeCoAlarm + 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 598669e8ec2603..523d92c4326c3f 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 @@ -267,6 +267,56 @@ static constexpr EventId Id = 0x00000000; } // namespace Events } // namespace BooleanState +namespace SmokeCoAlarm { +namespace Events { + +namespace SmokeAlarm { +static constexpr EventId Id = 0x00000000; +} // namespace SmokeAlarm + +namespace COAlarm { +static constexpr EventId Id = 0x00000001; +} // namespace COAlarm + +namespace LowBattery { +static constexpr EventId Id = 0x00000002; +} // namespace LowBattery + +namespace HardwareFault { +static constexpr EventId Id = 0x00000003; +} // namespace HardwareFault + +namespace EndOfService { +static constexpr EventId Id = 0x00000004; +} // namespace EndOfService + +namespace SelfTestComplete { +static constexpr EventId Id = 0x00000005; +} // namespace SelfTestComplete + +namespace AlarmMuted { +static constexpr EventId Id = 0x00000006; +} // namespace AlarmMuted + +namespace MuteEnded { +static constexpr EventId Id = 0x00000007; +} // namespace MuteEnded + +namespace InterconnectSmokeAlarm { +static constexpr EventId Id = 0x00000008; +} // namespace InterconnectSmokeAlarm + +namespace InterconnectCOAlarm { +static constexpr EventId Id = 0x00000009; +} // namespace InterconnectCOAlarm + +namespace AllClear { +static constexpr EventId Id = 0x0000000A; +} // namespace AllClear + +} // namespace Events +} // namespace SmokeCoAlarm + 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 d70d6320348c88..76e325f4fb0c76 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 @@ -298,6 +298,12 @@ #define CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER #endif +#if defined(ZCL_USING_SMOKE_CO_ALARM_CLUSTER_SERVER) || defined(ZCL_USING_SMOKE_CO_ALARM_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER { chip::app::Clusters::SmokeCoAlarm::Id, "Smoke CO Alarm" }, +#else +#define CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_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" }, @@ -320,11 +326,12 @@ #define CHIP_PRINTCLUSTER_CERAMIC_FILTER_MONITORING_CLUSTER #endif -#if defined(ZCL_USING_ELECTROSTATIC_FILTER_MONITORING_SERVER) || defined(ZCL_USING_ELECTROSTATIC_FILTER_MONITORING_CLIENT) -#define CHIP_PRINTCLUSTER_ELECTROSTATIC_FILTER_MONITORING \ +#if defined(ZCL_USING_ELECTROSTATIC_FILTER_MONITORING_CLUSTER_SERVER) || \ + defined(ZCL_USING_ELECTROSTATIC_FILTER_MONITORING_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_ELECTROSTATIC_FILTER_MONITORING_CLUSTER \ { chip::app::Clusters::ElectrostaticFilterMonitoring::Id, "Electrostatic Filter Monitoring" }, #else -#define CHIP_PRINTCLUSTER_ELECTROSTATIC_FILTER_MONITORING +#define CHIP_PRINTCLUSTER_ELECTROSTATIC_FILTER_MONITORING_CLUSTER #endif #if defined(ZCL_USING_UV_FILTER_MONITORING_CLUSTER_SERVER) || defined(ZCL_USING_UV_FILTER_MONITORING_CLUSTER_CLIENT) @@ -340,11 +347,11 @@ #define CHIP_PRINTCLUSTER_IONIZING_FILTER_MONITORING_CLUSTER #endif -#if defined(ZCL_USING_ZEOLITE_FILTER_MONITORING_SERVER) || defined(ZCL_USING_ZEOLITE_FILTER_MONITORING_CLIENT) -#define CHIP_PRINTCLUSTER_ZEOLITE_FILTER_MONITORING \ +#if defined(ZCL_USING_ZEOLITE_FILTER_MONITORING_CLUSTER_SERVER) || defined(ZCL_USING_ZEOLITE_FILTER_MONITORING_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_ZEOLITE_FILTER_MONITORING_CLUSTER \ { chip::app::Clusters::ZeoliteFilterMonitoring::Id, "Zeolite Filter Monitoring" }, #else -#define CHIP_PRINTCLUSTER_ZEOLITE_FILTER_MONITORING +#define CHIP_PRINTCLUSTER_ZEOLITE_FILTER_MONITORING_CLUSTER #endif #if defined(ZCL_USING_OZONE_FILTER_MONITORING_CLUSTER_SERVER) || defined(ZCL_USING_OZONE_FILTER_MONITORING_CLUSTER_CLIENT) @@ -613,13 +620,14 @@ CHIP_PRINTCLUSTER_ICD_MANAGEMENT_CLUSTER \ CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER \ CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER \ + CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER \ CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_CERAMIC_FILTER_MONITORING_CLUSTER \ - CHIP_PRINTCLUSTER_ELECTROSTATIC_FILTER_MONITORING \ + CHIP_PRINTCLUSTER_ELECTROSTATIC_FILTER_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_UV_FILTER_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_IONIZING_FILTER_MONITORING_CLUSTER \ - CHIP_PRINTCLUSTER_ZEOLITE_FILTER_MONITORING \ + CHIP_PRINTCLUSTER_ZEOLITE_FILTER_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_OZONE_FILTER_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_WATER_TANK_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_FUEL_TANK_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 f6f8372534ef24..d341aa1b80aaca 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -75,6 +75,7 @@ | IcdManagement | 0x0046 | | ModeSelect | 0x0050 | | AirQuality | 0x005B | +| SmokeCoAlarm | 0x005C | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -4053,6 +4054,76 @@ class ModeSelectChangeToMode : public ClusterCommand | Events: | | \*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*\ +| Cluster SmokeCoAlarm | 0x005C | +|------------------------------------------------------------------------------| +| Commands: | | +| * SelfTestRequest | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * ExpressedState | 0x0000 | +| * SmokeState | 0x0001 | +| * COState | 0x0002 | +| * BatteryAlert | 0x0003 | +| * DeviceMuted | 0x0004 | +| * TestInProgress | 0x0005 | +| * HardwareFaultAlert | 0x0006 | +| * EndOfServiceAlert | 0x0007 | +| * InterconnectSmokeAlarm | 0x0008 | +| * InterconnectCOAlarm | 0x0009 | +| * ContaminationState | 0x000A | +| * SensitivityLevel | 0x000B | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * SmokeAlarm | 0x0000 | +| * COAlarm | 0x0001 | +| * LowBattery | 0x0002 | +| * HardwareFault | 0x0003 | +| * EndOfService | 0x0004 | +| * SelfTestComplete | 0x0005 | +| * AlarmMuted | 0x0006 | +| * MuteEnded | 0x0007 | +| * InterconnectSmokeAlarm | 0x0008 | +| * InterconnectCOAlarm | 0x0009 | +| * AllClear | 0x000A | +\*----------------------------------------------------------------------------*/ + +/* + * Command SelfTestRequest + */ +class SmokeCoAlarmSelfTestRequest : public ClusterCommand +{ +public: + SmokeCoAlarmSelfTestRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("self-test-request", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) command (0x00000000) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x0000005C, 0x00000000, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) command (0x00000000) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x0000005C, 0x00000000, mRequest); + } + +private: + chip::app::Clusters::SmokeCoAlarm::Commands::SelfTestRequest::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster HepaFilterMonitoring | 0x0071 | |------------------------------------------------------------------------------| @@ -12906,6 +12977,135 @@ void registerClusterAirQuality(Commands & commands, CredentialIssuerCommands * c commands.Register(clusterName, clusterCommands); } +void registerClusterSmokeCoAlarm(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::SmokeCoAlarm; + + const char * clusterName = "SmokeCoAlarm"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "expressed-state", Attributes::ExpressedState::Id, credsIssuerConfig), // + make_unique(Id, "smoke-state", Attributes::SmokeState::Id, credsIssuerConfig), // + make_unique(Id, "costate", Attributes::COState::Id, credsIssuerConfig), // + make_unique(Id, "battery-alert", Attributes::BatteryAlert::Id, credsIssuerConfig), // + make_unique(Id, "device-muted", Attributes::DeviceMuted::Id, credsIssuerConfig), // + make_unique(Id, "test-in-progress", Attributes::TestInProgress::Id, credsIssuerConfig), // + make_unique(Id, "hardware-fault-alert", Attributes::HardwareFaultAlert::Id, credsIssuerConfig), // + make_unique(Id, "end-of-service-alert", Attributes::EndOfServiceAlert::Id, credsIssuerConfig), // + make_unique(Id, "interconnect-smoke-alarm", Attributes::InterconnectSmokeAlarm::Id, credsIssuerConfig), // + make_unique(Id, "interconnect-coalarm", Attributes::InterconnectCOAlarm::Id, credsIssuerConfig), // + make_unique(Id, "contamination-state", Attributes::ContaminationState::Id, credsIssuerConfig), // + make_unique(Id, "sensitivity-level", Attributes::SensitivityLevel::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, "expressed-state", 0, UINT8_MAX, Attributes::ExpressedState::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>( + Id, "smoke-state", 0, UINT8_MAX, Attributes::SmokeState::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "costate", 0, UINT8_MAX, Attributes::COState::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "battery-alert", 0, UINT8_MAX, Attributes::BatteryAlert::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "device-muted", 0, UINT8_MAX, Attributes::DeviceMuted::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "test-in-progress", 0, 1, Attributes::TestInProgress::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "hardware-fault-alert", 0, 1, Attributes::HardwareFaultAlert::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "end-of-service-alert", 0, UINT8_MAX, Attributes::EndOfServiceAlert::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>( + Id, "interconnect-smoke-alarm", 0, UINT8_MAX, Attributes::InterconnectSmokeAlarm::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>( + Id, "interconnect-coalarm", 0, UINT8_MAX, Attributes::InterconnectCOAlarm::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>( + Id, "contamination-state", 0, UINT8_MAX, Attributes::ContaminationState::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>( + Id, "sensitivity-level", 0, UINT8_MAX, Attributes::SensitivityLevel::Id, WriteCommandType::kWrite, + 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, "expressed-state", Attributes::ExpressedState::Id, credsIssuerConfig), // + make_unique(Id, "smoke-state", Attributes::SmokeState::Id, credsIssuerConfig), // + make_unique(Id, "costate", Attributes::COState::Id, credsIssuerConfig), // + make_unique(Id, "battery-alert", Attributes::BatteryAlert::Id, credsIssuerConfig), // + make_unique(Id, "device-muted", Attributes::DeviceMuted::Id, credsIssuerConfig), // + make_unique(Id, "test-in-progress", Attributes::TestInProgress::Id, credsIssuerConfig), // + make_unique(Id, "hardware-fault-alert", Attributes::HardwareFaultAlert::Id, credsIssuerConfig), // + make_unique(Id, "end-of-service-alert", Attributes::EndOfServiceAlert::Id, credsIssuerConfig), // + make_unique(Id, "interconnect-smoke-alarm", Attributes::InterconnectSmokeAlarm::Id, + credsIssuerConfig), // + make_unique(Id, "interconnect-coalarm", Attributes::InterconnectCOAlarm::Id, credsIssuerConfig), // + make_unique(Id, "contamination-state", Attributes::ContaminationState::Id, credsIssuerConfig), // + make_unique(Id, "sensitivity-level", Attributes::SensitivityLevel::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, "smoke-alarm", Events::SmokeAlarm::Id, credsIssuerConfig), // + make_unique(Id, "coalarm", Events::COAlarm::Id, credsIssuerConfig), // + make_unique(Id, "low-battery", Events::LowBattery::Id, credsIssuerConfig), // + make_unique(Id, "hardware-fault", Events::HardwareFault::Id, credsIssuerConfig), // + make_unique(Id, "end-of-service", Events::EndOfService::Id, credsIssuerConfig), // + make_unique(Id, "self-test-complete", Events::SelfTestComplete::Id, credsIssuerConfig), // + make_unique(Id, "alarm-muted", Events::AlarmMuted::Id, credsIssuerConfig), // + make_unique(Id, "mute-ended", Events::MuteEnded::Id, credsIssuerConfig), // + make_unique(Id, "interconnect-smoke-alarm", Events::InterconnectSmokeAlarm::Id, credsIssuerConfig), // + make_unique(Id, "interconnect-coalarm", Events::InterconnectCOAlarm::Id, credsIssuerConfig), // + make_unique(Id, "all-clear", Events::AllClear::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "smoke-alarm", Events::SmokeAlarm::Id, credsIssuerConfig), // + make_unique(Id, "coalarm", Events::COAlarm::Id, credsIssuerConfig), // + make_unique(Id, "low-battery", Events::LowBattery::Id, credsIssuerConfig), // + make_unique(Id, "hardware-fault", Events::HardwareFault::Id, credsIssuerConfig), // + make_unique(Id, "end-of-service", Events::EndOfService::Id, credsIssuerConfig), // + make_unique(Id, "self-test-complete", Events::SelfTestComplete::Id, credsIssuerConfig), // + make_unique(Id, "alarm-muted", Events::AlarmMuted::Id, credsIssuerConfig), // + make_unique(Id, "mute-ended", Events::MuteEnded::Id, credsIssuerConfig), // + make_unique(Id, "interconnect-smoke-alarm", Events::InterconnectSmokeAlarm::Id, credsIssuerConfig), // + make_unique(Id, "interconnect-coalarm", Events::InterconnectCOAlarm::Id, credsIssuerConfig), // + make_unique(Id, "all-clear", Events::AllClear::Id, credsIssuerConfig), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterHepaFilterMonitoring(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::HepaFilterMonitoring; @@ -17917,6 +18117,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterIcdManagement(commands, credsIssuerConfig); registerClusterModeSelect(commands, credsIssuerConfig); registerClusterAirQuality(commands, credsIssuerConfig); + registerClusterSmokeCoAlarm(commands, credsIssuerConfig); registerClusterHepaFilterMonitoring(commands, credsIssuerConfig); registerClusterActivatedCarbonFilterMonitoring(commands, credsIssuerConfig); registerClusterCeramicFilterMonitoring(commands, credsIssuerConfig); 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 57fcae98c7fddd..7bd428b540db1c 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -3521,6 +3521,92 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::SmokeAlarm::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const SmokeCoAlarm::Events::COAlarm::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::LowBattery::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::HardwareFault::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::EndOfService::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::SelfTestComplete::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::AlarmMuted::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::MuteEnded::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::InterconnectSmokeAlarm::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::InterconnectCOAlarm::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const SmokeCoAlarm::Events::AllClear::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const DoorLock::Events::DoorLockAlarm::DecodableType & value) { @@ -7572,6 +7658,102 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case SmokeCoAlarm::Id: { + switch (path.mAttributeId) + { + case SmokeCoAlarm::Attributes::ExpressedState::Id: { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ExpressedState", 1, value); + } + case SmokeCoAlarm::Attributes::SmokeState::Id: { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SmokeState", 1, value); + } + case SmokeCoAlarm::Attributes::COState::Id: { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("COState", 1, value); + } + case SmokeCoAlarm::Attributes::BatteryAlert::Id: { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BatteryAlert", 1, value); + } + case SmokeCoAlarm::Attributes::DeviceMuted::Id: { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("DeviceMuted", 1, value); + } + case SmokeCoAlarm::Attributes::TestInProgress::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TestInProgress", 1, value); + } + case SmokeCoAlarm::Attributes::HardwareFaultAlert::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("HardwareFaultAlert", 1, value); + } + case SmokeCoAlarm::Attributes::EndOfServiceAlert::Id: { + chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EndOfServiceAlert", 1, value); + } + case SmokeCoAlarm::Attributes::InterconnectSmokeAlarm::Id: { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("InterconnectSmokeAlarm", 1, value); + } + case SmokeCoAlarm::Attributes::InterconnectCOAlarm::Id: { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("InterconnectCOAlarm", 1, value); + } + case SmokeCoAlarm::Attributes::ContaminationState::Id: { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ContaminationState", 1, value); + } + case SmokeCoAlarm::Attributes::SensitivityLevel::Id: { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SensitivityLevel", 1, value); + } + case SmokeCoAlarm::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case SmokeCoAlarm::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case SmokeCoAlarm::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case SmokeCoAlarm::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case SmokeCoAlarm::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case SmokeCoAlarm::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) { @@ -12563,6 +12745,67 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case SmokeCoAlarm::Id: { + switch (header.mPath.mEventId) + { + case SmokeCoAlarm::Events::SmokeAlarm::Id: { + chip::app::Clusters::SmokeCoAlarm::Events::SmokeAlarm::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SmokeAlarm", 1, value); + } + case SmokeCoAlarm::Events::COAlarm::Id: { + chip::app::Clusters::SmokeCoAlarm::Events::COAlarm::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("COAlarm", 1, value); + } + case SmokeCoAlarm::Events::LowBattery::Id: { + chip::app::Clusters::SmokeCoAlarm::Events::LowBattery::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LowBattery", 1, value); + } + case SmokeCoAlarm::Events::HardwareFault::Id: { + chip::app::Clusters::SmokeCoAlarm::Events::HardwareFault::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("HardwareFault", 1, value); + } + case SmokeCoAlarm::Events::EndOfService::Id: { + chip::app::Clusters::SmokeCoAlarm::Events::EndOfService::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EndOfService", 1, value); + } + case SmokeCoAlarm::Events::SelfTestComplete::Id: { + chip::app::Clusters::SmokeCoAlarm::Events::SelfTestComplete::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SelfTestComplete", 1, value); + } + case SmokeCoAlarm::Events::AlarmMuted::Id: { + chip::app::Clusters::SmokeCoAlarm::Events::AlarmMuted::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AlarmMuted", 1, value); + } + case SmokeCoAlarm::Events::MuteEnded::Id: { + chip::app::Clusters::SmokeCoAlarm::Events::MuteEnded::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MuteEnded", 1, value); + } + case SmokeCoAlarm::Events::InterconnectSmokeAlarm::Id: { + chip::app::Clusters::SmokeCoAlarm::Events::InterconnectSmokeAlarm::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("InterconnectSmokeAlarm", 1, value); + } + case SmokeCoAlarm::Events::InterconnectCOAlarm::Id: { + chip::app::Clusters::SmokeCoAlarm::Events::InterconnectCOAlarm::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("InterconnectCOAlarm", 1, value); + } + case SmokeCoAlarm::Events::AllClear::Id: { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AllClear", 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 7d96f2afdd379c..7618f4dde6c048 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -301,6 +301,28 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Switch::Events::MultiPressComplete::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::BooleanState::Events::StateChange::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::SmokeCoAlarm::Events::SmokeAlarm::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::SmokeCoAlarm::Events::COAlarm::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::SmokeCoAlarm::Events::LowBattery::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::SmokeCoAlarm::Events::HardwareFault::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::SmokeCoAlarm::Events::EndOfService::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::SmokeCoAlarm::Events::SelfTestComplete::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::SmokeCoAlarm::Events::AlarmMuted::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::SmokeCoAlarm::Events::MuteEnded::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::SmokeCoAlarm::Events::InterconnectSmokeAlarm::DecodableType & value); +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::DoorLock::Events::DoorLockAlarm::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 7fa5e6a3d30808..d6c105e6727029 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -78,6 +78,7 @@ | IcdManagement | 0x0046 | | ModeSelect | 0x0050 | | AirQuality | 0x005B | +| SmokeCoAlarm | 0x005C | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -38387,6 +38388,1389 @@ class SubscribeAttributeAirQualityClusterRevision : public SubscribeAttribute { } }; +/*----------------------------------------------------------------------------*\ +| Cluster SmokeCoAlarm | 0x005C | +|------------------------------------------------------------------------------| +| Commands: | | +| * SelfTestRequest | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * ExpressedState | 0x0000 | +| * SmokeState | 0x0001 | +| * COState | 0x0002 | +| * BatteryAlert | 0x0003 | +| * DeviceMuted | 0x0004 | +| * TestInProgress | 0x0005 | +| * HardwareFaultAlert | 0x0006 | +| * EndOfServiceAlert | 0x0007 | +| * InterconnectSmokeAlarm | 0x0008 | +| * InterconnectCOAlarm | 0x0009 | +| * ContaminationState | 0x000A | +| * SensitivityLevel | 0x000B | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * SmokeAlarm | 0x0000 | +| * COAlarm | 0x0001 | +| * LowBattery | 0x0002 | +| * HardwareFault | 0x0003 | +| * EndOfService | 0x0004 | +| * SelfTestComplete | 0x0005 | +| * AlarmMuted | 0x0006 | +| * MuteEnded | 0x0007 | +| * InterconnectSmokeAlarm | 0x0008 | +| * InterconnectCOAlarm | 0x0009 | +| * AllClear | 0x000A | +\*----------------------------------------------------------------------------*/ + +/* + * Command SelfTestRequest + */ +class SmokeCoAlarmSelfTestRequest : public ClusterCommand { +public: + SmokeCoAlarmSelfTestRequest() + : ClusterCommand("self-test-request") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSmokeCOAlarmClusterSelfTestRequestParams 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 selfTestRequestWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Attribute ExpressedState + */ +class ReadSmokeCoAlarmExpressedState : public ReadAttribute { +public: + ReadSmokeCoAlarmExpressedState() + : ReadAttribute("expressed-state") + { + } + + ~ReadSmokeCoAlarmExpressedState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeExpressedStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.ExpressedState response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm ExpressedState read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmExpressedState : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmExpressedState() + : SubscribeAttribute("expressed-state") + { + } + + ~SubscribeAttributeSmokeCoAlarmExpressedState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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 subscribeAttributeExpressedStateWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.ExpressedState response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute SmokeState + */ +class ReadSmokeCoAlarmSmokeState : public ReadAttribute { +public: + ReadSmokeCoAlarmSmokeState() + : ReadAttribute("smoke-state") + { + } + + ~ReadSmokeCoAlarmSmokeState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeSmokeStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.SmokeState response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm SmokeState read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmSmokeState : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmSmokeState() + : SubscribeAttribute("smoke-state") + { + } + + ~SubscribeAttributeSmokeCoAlarmSmokeState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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 subscribeAttributeSmokeStateWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.SmokeState response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute COState + */ +class ReadSmokeCoAlarmCOState : public ReadAttribute { +public: + ReadSmokeCoAlarmCOState() + : ReadAttribute("costate") + { + } + + ~ReadSmokeCoAlarmCOState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeCOStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.COState response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm COState read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmCOState : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmCOState() + : SubscribeAttribute("costate") + { + } + + ~SubscribeAttributeSmokeCoAlarmCOState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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 subscribeAttributeCOStateWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.COState response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute BatteryAlert + */ +class ReadSmokeCoAlarmBatteryAlert : public ReadAttribute { +public: + ReadSmokeCoAlarmBatteryAlert() + : ReadAttribute("battery-alert") + { + } + + ~ReadSmokeCoAlarmBatteryAlert() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeBatteryAlertWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.BatteryAlert response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm BatteryAlert read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmBatteryAlert : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmBatteryAlert() + : SubscribeAttribute("battery-alert") + { + } + + ~SubscribeAttributeSmokeCoAlarmBatteryAlert() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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 subscribeAttributeBatteryAlertWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.BatteryAlert response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute DeviceMuted + */ +class ReadSmokeCoAlarmDeviceMuted : public ReadAttribute { +public: + ReadSmokeCoAlarmDeviceMuted() + : ReadAttribute("device-muted") + { + } + + ~ReadSmokeCoAlarmDeviceMuted() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeDeviceMutedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.DeviceMuted response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm DeviceMuted read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmDeviceMuted : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmDeviceMuted() + : SubscribeAttribute("device-muted") + { + } + + ~SubscribeAttributeSmokeCoAlarmDeviceMuted() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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 subscribeAttributeDeviceMutedWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.DeviceMuted response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute TestInProgress + */ +class ReadSmokeCoAlarmTestInProgress : public ReadAttribute { +public: + ReadSmokeCoAlarmTestInProgress() + : ReadAttribute("test-in-progress") + { + } + + ~ReadSmokeCoAlarmTestInProgress() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeTestInProgressWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.TestInProgress response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm TestInProgress read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmTestInProgress : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmTestInProgress() + : SubscribeAttribute("test-in-progress") + { + } + + ~SubscribeAttributeSmokeCoAlarmTestInProgress() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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 subscribeAttributeTestInProgressWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.TestInProgress response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute HardwareFaultAlert + */ +class ReadSmokeCoAlarmHardwareFaultAlert : public ReadAttribute { +public: + ReadSmokeCoAlarmHardwareFaultAlert() + : ReadAttribute("hardware-fault-alert") + { + } + + ~ReadSmokeCoAlarmHardwareFaultAlert() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x00000006) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeHardwareFaultAlertWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.HardwareFaultAlert response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm HardwareFaultAlert read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmHardwareFaultAlert : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmHardwareFaultAlert() + : SubscribeAttribute("hardware-fault-alert") + { + } + + ~SubscribeAttributeSmokeCoAlarmHardwareFaultAlert() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x00000006) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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 subscribeAttributeHardwareFaultAlertWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.HardwareFaultAlert response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute EndOfServiceAlert + */ +class ReadSmokeCoAlarmEndOfServiceAlert : public ReadAttribute { +public: + ReadSmokeCoAlarmEndOfServiceAlert() + : ReadAttribute("end-of-service-alert") + { + } + + ~ReadSmokeCoAlarmEndOfServiceAlert() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x00000007) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeEndOfServiceAlertWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.EndOfServiceAlert response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm EndOfServiceAlert read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmEndOfServiceAlert : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmEndOfServiceAlert() + : SubscribeAttribute("end-of-service-alert") + { + } + + ~SubscribeAttributeSmokeCoAlarmEndOfServiceAlert() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x00000007) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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 subscribeAttributeEndOfServiceAlertWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.EndOfServiceAlert response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute InterconnectSmokeAlarm + */ +class ReadSmokeCoAlarmInterconnectSmokeAlarm : public ReadAttribute { +public: + ReadSmokeCoAlarmInterconnectSmokeAlarm() + : ReadAttribute("interconnect-smoke-alarm") + { + } + + ~ReadSmokeCoAlarmInterconnectSmokeAlarm() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x00000008) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeInterconnectSmokeAlarmWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.InterconnectSmokeAlarm response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm InterconnectSmokeAlarm read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmInterconnectSmokeAlarm : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmInterconnectSmokeAlarm() + : SubscribeAttribute("interconnect-smoke-alarm") + { + } + + ~SubscribeAttributeSmokeCoAlarmInterconnectSmokeAlarm() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x00000008) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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 subscribeAttributeInterconnectSmokeAlarmWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.InterconnectSmokeAlarm response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute InterconnectCOAlarm + */ +class ReadSmokeCoAlarmInterconnectCOAlarm : public ReadAttribute { +public: + ReadSmokeCoAlarmInterconnectCOAlarm() + : ReadAttribute("interconnect-coalarm") + { + } + + ~ReadSmokeCoAlarmInterconnectCOAlarm() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x00000009) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeInterconnectCOAlarmWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.InterconnectCOAlarm response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm InterconnectCOAlarm read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmInterconnectCOAlarm : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmInterconnectCOAlarm() + : SubscribeAttribute("interconnect-coalarm") + { + } + + ~SubscribeAttributeSmokeCoAlarmInterconnectCOAlarm() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x00000009) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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 subscribeAttributeInterconnectCOAlarmWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.InterconnectCOAlarm response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ContaminationState + */ +class ReadSmokeCoAlarmContaminationState : public ReadAttribute { +public: + ReadSmokeCoAlarmContaminationState() + : ReadAttribute("contamination-state") + { + } + + ~ReadSmokeCoAlarmContaminationState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x0000000A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeContaminationStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.ContaminationState response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm ContaminationState read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmContaminationState : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmContaminationState() + : SubscribeAttribute("contamination-state") + { + } + + ~SubscribeAttributeSmokeCoAlarmContaminationState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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 subscribeAttributeContaminationStateWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.ContaminationState response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute SensitivityLevel + */ +class ReadSmokeCoAlarmSensitivityLevel : public ReadAttribute { +public: + ReadSmokeCoAlarmSensitivityLevel() + : ReadAttribute("sensitivity-level") + { + } + + ~ReadSmokeCoAlarmSensitivityLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x0000000B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeSensitivityLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.SensitivityLevel response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm SensitivityLevel read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteSmokeCoAlarmSensitivityLevel : public WriteAttribute { +public: + WriteSmokeCoAlarmSensitivityLevel() + : WriteAttribute("sensitivity-level") + { + AddArgument("attr-name", "sensitivity-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteSmokeCoAlarmSensitivityLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) WriteAttribute (0x0000000B) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSensitivityLevelWithValue:value + params:params + completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("SmokeCOAlarm SensitivityLevel write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeSmokeCoAlarmSensitivityLevel : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmSensitivityLevel() + : SubscribeAttribute("sensitivity-level") + { + } + + ~SubscribeAttributeSmokeCoAlarmSensitivityLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x0000000B) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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 subscribeAttributeSensitivityLevelWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.SensitivityLevel response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadSmokeCoAlarmGeneratedCommandList : public ReadAttribute { +public: + ReadSmokeCoAlarmGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadSmokeCoAlarmGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.GeneratedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm GeneratedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeSmokeCoAlarmGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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(@"SmokeCOAlarm.GeneratedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadSmokeCoAlarmAcceptedCommandList : public ReadAttribute { +public: + ReadSmokeCoAlarmAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadSmokeCoAlarmAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.AcceptedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm AcceptedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeSmokeCoAlarmAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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(@"SmokeCOAlarm.AcceptedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute EventList + */ +class ReadSmokeCoAlarmEventList : public ReadAttribute { +public: + ReadSmokeCoAlarmEventList() + : ReadAttribute("event-list") + { + } + + ~ReadSmokeCoAlarmEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x0000FFFA) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.EventList response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm EventList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmEventList : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeSmokeCoAlarmEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x0000FFFA) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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(@"SmokeCOAlarm.EventList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AttributeList + */ +class ReadSmokeCoAlarmAttributeList : public ReadAttribute { +public: + ReadSmokeCoAlarmAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadSmokeCoAlarmAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.AttributeList response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm AttributeList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeSmokeCoAlarmAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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(@"SmokeCOAlarm.AttributeList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute FeatureMap + */ +class ReadSmokeCoAlarmFeatureMap : public ReadAttribute { +public: + ReadSmokeCoAlarmFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadSmokeCoAlarmFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.FeatureMap response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm FeatureMap read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeSmokeCoAlarmFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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(@"SmokeCOAlarm.FeatureMap response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadSmokeCoAlarmClusterRevision : public ReadAttribute { +public: + ReadSmokeCoAlarmClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadSmokeCoAlarmClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SmokeCOAlarm.ClusterRevision response %@", [value description]); + if (error != nil) { + LogNSError("SmokeCOAlarm ClusterRevision read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSmokeCoAlarmClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeSmokeCoAlarmClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeSmokeCoAlarmClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000005C) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSmokeCOAlarm 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(@"SmokeCOAlarm.ClusterRevision response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + /*----------------------------------------------------------------------------*\ | Cluster HepaFilterMonitoring | 0x0071 | |------------------------------------------------------------------------------| @@ -108099,6 +109483,61 @@ void registerClusterAirQuality(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterSmokeCoAlarm(Commands & commands) +{ + using namespace chip::app::Clusters::SmokeCoAlarm; + + const char * clusterName = "SmokeCoAlarm"; + + commands_list clusterCommands = { + make_unique(Id), // + 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(), // + 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; @@ -110585,6 +112024,7 @@ void registerClusters(Commands & commands) registerClusterBooleanState(commands); registerClusterModeSelect(commands); registerClusterAirQuality(commands); + registerClusterSmokeCoAlarm(commands); registerClusterHepaFilterMonitoring(commands); registerClusterActivatedCarbonFilterMonitoring(commands); registerClusterCeramicFilterMonitoring(commands); diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h index 86b32af0a2a6a4..01c46405758d23 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -435,6 +435,14 @@ typedef void (*AirQualityEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*AirQualityAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*SmokeCoAlarmGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*SmokeCoAlarmAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*SmokeCoAlarmEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*SmokeCoAlarmAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); typedef void (*HepaFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HepaFilterMonitoringAcceptedCommandListListAttributeCallback)( diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h index 3917b0f4fb2f56..db17098cf93914 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h @@ -384,6 +384,15 @@ class DLL_EXPORT AirQualityCluster : public ClusterBase ~AirQualityCluster() {} }; +class DLL_EXPORT SmokeCoAlarmCluster : public ClusterBase +{ +public: + SmokeCoAlarmCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, EndpointId endpoint) : + ClusterBase(exchangeManager, session, endpoint) + {} + ~SmokeCoAlarmCluster() {} +}; + class DLL_EXPORT HepaFilterMonitoringCluster : public ClusterBase { public: diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h b/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h index 69d3c3a4651896..345ab29adbfc03 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h @@ -59,7 +59,7 @@ #define GENERATED_FUNCTION_ARRAYS // This is an array of EmberAfCluster structures. -#define GENERATED_CLUSTER_COUNT 79 +#define GENERATED_CLUSTER_COUNT 80 // clang-format off #define GENERATED_CLUSTERS { \ { \ @@ -556,6 +556,19 @@ .eventList = nullptr, \ .eventCount = 0, \ },\ + { \ + /* Endpoint: 1, Cluster: Smoke CO Alarm (client) */ \ + .clusterId = 0x0000005C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .acceptedCommandList = nullptr, \ + .generatedCommandList = nullptr, \ + .eventList = nullptr, \ + .eventCount = 0, \ + },\ { \ /* Endpoint: 1, Cluster: HEPA Filter Monitoring (client) */ \ .clusterId = 0x00000071, \ @@ -1098,7 +1111,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 79, 0 }, \ + { ZAP_CLUSTER_INDEX(0), 80, 0 }, \ } // Largest attribute size is needed for various buffers diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h b/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h index 38138d04bea7da..a7f94ba50a2fdf 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h @@ -59,13 +59,14 @@ #define EMBER_AF_ICD_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_MODE_SELECT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_AIR_QUALITY_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_SMOKE_CO_ALARM_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_HEPA_FILTER_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_CERAMIC_FILTER_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) -#define EMBER_AF_ELECTROSTATIC_FILTER_MONITORING_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_ELECTROSTATIC_FILTER_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_UV_FILTER_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_IONIZING_FILTER_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) -#define EMBER_AF_ZEOLITE_FILTER_MONITORING_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_ZEOLITE_FILTER_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_OZONE_FILTER_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_WATER_TANK_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_FUEL_TANK_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -255,6 +256,10 @@ #define ZCL_USING_AIR_QUALITY_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_AIR_QUALITY_CLIENT +// Use this macro to check if the client side of the Smoke CO Alarm cluster is included +#define ZCL_USING_SMOKE_CO_ALARM_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_SMOKE_CO_ALARM_CLIENT + // Use this macro to check if the client side of the HEPA Filter Monitoring cluster is included #define ZCL_USING_HEPA_FILTER_MONITORING_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_HEPA_FILTER_MONITORING_CLIENT @@ -268,7 +273,7 @@ #define EMBER_AF_PLUGIN_CERAMIC_FILTER_MONITORING_CLIENT // Use this macro to check if the client side of the Electrostatic Filter Monitoring cluster is included -#define ZCL_USING_ELECTROSTATIC_FILTER_MONITORING_CLIENT +#define ZCL_USING_ELECTROSTATIC_FILTER_MONITORING_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_ELECTROSTATIC_FILTER_MONITORING_CLIENT // Use this macro to check if the client side of the UV Filter Monitoring cluster is included @@ -280,7 +285,7 @@ #define EMBER_AF_PLUGIN_IONIZING_FILTER_MONITORING_CLIENT // Use this macro to check if the client side of the Zeolite Filter Monitoring cluster is included -#define ZCL_USING_ZEOLITE_FILTER_MONITORING_CLIENT +#define ZCL_USING_ZEOLITE_FILTER_MONITORING_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_ZEOLITE_FILTER_MONITORING_CLIENT // Use this macro to check if the client side of the Ozone Filter Monitoring cluster is included