From 2360948c423fce06452c96192828b31c9df1f0b1 Mon Sep 17 00:00:00 2001 From: fesseha-eve <88329315+fessehaeve@users.noreply.github.com> Date: Mon, 25 Oct 2021 20:48:34 +0200 Subject: [PATCH] Add illuminance measurement cluster (#10776) * Added Illuminance Measurement cluster XML and source files Removed duplicate/similar instances of illuminance cluster. * Regenerate all * Regenerate all * Restyled by prettier-json * Restyled by autopep8 * Removed files with no logic * Rebase on ToT and regenerate * Rebase and revert zap related issue * Regenerating * Regenerating * Restyled by autopep8 * update XML for isNullable attributes accordingly * Regenerate after isNullable changes * Rebase and regenerate Co-authored-by: Restyled.io Co-authored-by: Justin Wood --- .../all-clusters-common/all-clusters-app.zap | 254 ++++++++++++++++ .../chip/illuminance-measurement-cluster.xml | 42 +++ .../zcl/data-model/silabs/ha.xml | 33 -- .../zcl/data-model/silabs/types.xml | 8 - src/app/zap-templates/zcl/zcl.json | 1 + src/app/zap_cluster_list.py | 2 + .../data_model/controller-clusters.zap | 127 ++++++++ .../java/zap-generated/CHIPClusters-JNI.cpp | 212 +++++++++++++ .../chip/devicecontroller/ChipClusters.java | 70 +++++ .../python/chip/clusters/CHIPClusters.cpp | 77 +++++ .../python/chip/clusters/CHIPClusters.py | 91 ++++++ .../python/chip/clusters/Objects.py | 76 +---- .../CHIP/zap-generated/CHIPClustersObjc.h | 24 ++ .../CHIP/zap-generated/CHIPClustersObjc.mm | 70 +++++ .../zap-generated/CHIPClustersObjc_internal.h | 4 + .../CHIP/zap-generated/CHIPTestClustersObjc.h | 15 + .../zap-generated/CHIPTestClustersObjc.mm | 55 ++++ .../Framework/CHIPTests/CHIPClustersTests.m | 114 +++++++ .../PluginApplicationCallbacks.h | 1 + .../zap-generated/callback-stub.cpp | 8 + .../zap-generated/endpoint_config.h | 65 ++-- .../zap-generated/gen_config.h | 6 + .../app-common/zap-generated/attribute-id.h | 11 +- .../zap-generated/attributes/Accessors.cpp | 51 ---- .../zap-generated/attributes/Accessors.h | 21 -- .../app-common/zap-generated/callback.h | 112 ------- .../zap-generated/callbacks/PluginCallbacks.h | 3 - .../app-common/zap-generated/cluster-id.h | 5 +- .../zap-generated/cluster-objects.cpp | 9 - .../zap-generated/cluster-objects.h | 67 +---- .../app-common/zap-generated/enums.h | 21 +- .../app-common/zap-generated/ids/Attributes.h | 26 -- .../app-common/zap-generated/ids/Clusters.h | 3 - .../app-common/zap-generated/print-cluster.h | 16 +- .../zap-generated/cluster/Commands.h | 282 ++++++++++++++++++ .../zap-generated/reporting/Commands.h | 6 + .../zap-generated/CHIPClusters.cpp | 92 ++++++ .../zap-generated/CHIPClusters.h | 18 ++ .../PluginApplicationCallbacks.h | 1 + .../zap-generated/callback-stub.cpp | 8 + .../zap-generated/endpoint_config.h | 56 ++-- .../zap-generated/gen_config.h | 5 + .../zap-generated/tests/CHIPClustersTest.cpp | 64 ++++ .../zap-generated/tests/CHIPClustersTest.h | 20 ++ 44 files changed, 1769 insertions(+), 483 deletions(-) create mode 100644 src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 0f24e45b475978..bb162e13df218e 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -5535,6 +5535,133 @@ } ] }, + { + "name": "Illuminance Measurement", + "code": 1024, + "mfgCode": null, + "define": "ILLUMINANCE_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Illuminance Measurement", + "code": 1024, + "mfgCode": null, + "define": "ILLUMINANCE_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LightSensorType", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFF", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Temperature Measurement", "code": 1026, @@ -12540,6 +12667,133 @@ } ] }, + { + "name": "Illuminance Measurement", + "code": 1024, + "mfgCode": null, + "define": "ILLUMINANCE_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Illuminance Measurement", + "code": 1024, + "mfgCode": null, + "define": "ILLUMINANCE_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LightSensorType", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFF", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Temperature Measurement", "code": 1026, diff --git a/src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml new file mode 100644 index 00000000000000..497c27fbb5b9ec --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml @@ -0,0 +1,42 @@ + + + + + + + Illuminance Measurement + Measurement & Sensing + Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. + 0x0400 + ILLUMINANCE_MEASUREMENT_CLUSTER + true + true + + MeasuredValue + MinMeasuredValue + MaxMeasuredValue + Tolerance + LightSensorType + + + + + + + + +LST \ No newline at end of file diff --git a/src/app/zap-templates/zcl/data-model/silabs/ha.xml b/src/app/zap-templates/zcl/data-model/silabs/ha.xml index 4b1bbef5c9043d..7c62eab8335073 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/ha.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/ha.xml @@ -418,39 +418,6 @@ limitations under the License. lamp alarm mode lamp burn hours trip point - - Illuminance Measurement - Measurement & Sensing - Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. - 0x0400 - ILLUM_MEASUREMENT_CLUSTER - true - true - - measured value - - min measured value - - max measured value - - tolerance - - light sensor type - - - - Illuminance Level Sensing - Measurement & Sensing - Attributes and commands for configuring the sensing of illuminance levels, and reporting whether illuminance is above, below, or on target. - 0x0401 - ILLUM_LEVEL_SENSING_CLUSTER - true - true - level status - light sensor type - - illuminance level target - Occupancy Sensing Measurement & Sensing diff --git a/src/app/zap-templates/zcl/data-model/silabs/types.xml b/src/app/zap-templates/zcl/data-model/silabs/types.xml index 3476d1f6c05945..fc8e5ce0f05e5c 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/types.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/types.xml @@ -243,19 +243,11 @@ limitations under the License. - - - - - - - - diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 3f3fbc51f7d692..87da705b0355ed 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -28,6 +28,7 @@ "global-attributes.xml", "group-key-mgmt-cluster.xml", "identify-cluster.xml", + "illuminance-measurement-cluster.xml", "keypad-input-cluster.xml", "low-power-cluster.xml", "media-input-cluster.xml", diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index ba3eb7352d8802..1cd2025379cd1b 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -38,6 +38,7 @@ 'GROUP_KEY_MANAGEMENT_CLUSTER': [], 'IAS_ZONE_CLUSTER': ['ias-zone-server'], 'IDENTIFY_CLUSTER': ['identify-server'], + 'ILLUMINANCE_MEASUREMENT_CLUSTER': [], 'KEYPAD_INPUT_CLUSTER': ['keypad-input-server'], 'LEVEL_CONTROL_CLUSTER': ['level-control'], 'LOW_POWER_CLUSTER': ['low-power-server'], @@ -104,6 +105,7 @@ 'GROUP_KEY_MANAGEMENT_CLUSTER': [], 'IAS_ZONE_CLUSTER': ['ias-zone-client'], 'IDENTIFY_CLUSTER': [], + 'ILLUMINANCE_MEASUREMENT_CLUSTER': [], 'KEYPAD_INPUT_CLUSTER': [], 'LEVEL_CONTROL_CLUSTER': [], 'LOW_POWER_CLUSTER': [], diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index c98e102cc78739..ec8665349db952 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -8767,6 +8767,133 @@ } ] }, + { + "name": "Illuminance Measurement", + "code": 1024, + "mfgCode": null, + "define": "ILLUMINANCE_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Illuminance Measurement", + "code": 1024, + "mfgCode": null, + "define": "ILLUMINANCE_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LightSensorType", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFF", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Temperature Measurement", "code": 1026, diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index 9bfe5c129c5240..f552b837edcf5f 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -18319,6 +18319,218 @@ JNI_METHOD(void, IdentifyCluster, readClusterRevisionAttribute)(JNIEnv * env, jo onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, IlluminanceMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + IlluminanceMeasurementCluster * cppCluster = new IlluminanceMeasurementCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, IlluminanceMeasurementCluster, readMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + 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, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + 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, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->SubscribeAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), + static_cast(maxInterval)); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, IlluminanceMeasurementCluster, reportMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onReport( + Platform::New(callback, true), Platform::Delete); + VerifyOrReturn(onReport.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReportAttributeMeasuredValue(onReport->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, + ReturnIllegalStateException(env, callback, "Error registering for attribute reporting", err)); + + onReport.release(); +} + +JNI_METHOD(void, IlluminanceMeasurementCluster, readMinMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + 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, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, IlluminanceMeasurementCluster, readMaxMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + 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, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, IlluminanceMeasurementCluster, readToleranceAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + 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, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, IlluminanceMeasurementCluster, readLightSensorTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + 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, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeLightSensorType(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, IlluminanceMeasurementCluster, readClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + 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, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} JNI_METHOD(jlong, KeypadInputCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index f3b3c78180fff6..04f0ad51b86ef4 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -3467,6 +3467,76 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); } + public static class IlluminanceMeasurementCluster extends BaseChipCluster { + public IlluminanceMeasurementCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + public static long clusterId() { + return Long.parseUnsignedLong("1024"); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void readMeasuredValueAttribute(IntegerAttributeCallback callback) { + readMeasuredValueAttribute(chipClusterPtr, callback); + } + + public void subscribeMeasuredValueAttribute( + DefaultClusterCallback callback, int minInterval, int maxInterval) { + subscribeMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void reportMeasuredValueAttribute(IntegerAttributeCallback callback) { + reportMeasuredValueAttribute(chipClusterPtr, callback); + } + + public void readMinMeasuredValueAttribute(IntegerAttributeCallback callback) { + readMinMeasuredValueAttribute(chipClusterPtr, callback); + } + + public void readMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { + readMaxMeasuredValueAttribute(chipClusterPtr, callback); + } + + public void readToleranceAttribute(IntegerAttributeCallback callback) { + readToleranceAttribute(chipClusterPtr, callback); + } + + public void readLightSensorTypeAttribute(IntegerAttributeCallback callback) { + readLightSensorTypeAttribute(chipClusterPtr, callback); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + private native void readMeasuredValueAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeMeasuredValueAttribute( + long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); + + private native void reportMeasuredValueAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void readMinMeasuredValueAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void readMaxMeasuredValueAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void readToleranceAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void readLightSensorTypeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + } + public static class KeypadInputCluster extends BaseChipCluster { public KeypadInputCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index 20ee9b1479020e..5f203cc1930861 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -4592,6 +4592,83 @@ chip::ChipError::StorageType chip_ime_ReadAttribute_Identify_ClusterRevision(chi } // End of Cluster Identify +// Cluster IlluminanceMeasurement + +chip::ChipError::StorageType chip_ime_ReadAttribute_IlluminanceMeasurement_MeasuredValue(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_IlluminanceMeasurement_MeasuredValue(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_IlluminanceMeasurement_MinMeasuredValue(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_IlluminanceMeasurement_MaxMeasuredValue(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_IlluminanceMeasurement_Tolerance(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_IlluminanceMeasurement_LightSensorType(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLightSensorType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_IlluminanceMeasurement_ClusterRevision(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +// End of Cluster IlluminanceMeasurement // Cluster KeypadInput chip::ChipError::StorageType chip_ime_AppendCommand_KeypadInput_SendKey(chip::Controller::Device * device, diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 30ec4750eb3f27..42f4762dbba493 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -1873,6 +1873,45 @@ class ChipClusters: }, }, } + _ILLUMINANCE_MEASUREMENT_CLUSTER_INFO = { + "clusterName": "IlluminanceMeasurement", + "clusterId": 0x00000400, + "commands": { + }, + "attributes": { + 0x00000000: { + "attributeName": "MeasuredValue", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "MinMeasuredValue", + "attributeId": 0x00000001, + "type": "int", + }, + 0x00000002: { + "attributeName": "MaxMeasuredValue", + "attributeId": 0x00000002, + "type": "int", + }, + 0x00000003: { + "attributeName": "Tolerance", + "attributeId": 0x00000003, + "type": "int", + }, + 0x00000004: { + "attributeName": "LightSensorType", + "attributeId": 0x00000004, + "type": "int", + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + }, + }, + } _KEYPAD_INPUT_CLUSTER_INFO = { "clusterName": "KeypadInput", "clusterId": 0x00000509, @@ -4202,6 +4241,7 @@ class ChipClusters: 0x0000F004: _GROUP_KEY_MANAGEMENT_CLUSTER_INFO, 0x00000004: _GROUPS_CLUSTER_INFO, 0x00000003: _IDENTIFY_CLUSTER_INFO, + 0x00000400: _ILLUMINANCE_MEASUREMENT_CLUSTER_INFO, 0x00000509: _KEYPAD_INPUT_CLUSTER_INFO, 0x00000008: _LEVEL_CONTROL_CLUSTER_INFO, 0x00000508: _LOW_POWER_CLUSTER_INFO, @@ -4260,6 +4300,7 @@ class ChipClusters: "GroupKeyManagement": _GROUP_KEY_MANAGEMENT_CLUSTER_INFO, "Groups": _GROUPS_CLUSTER_INFO, "Identify": _IDENTIFY_CLUSTER_INFO, + "IlluminanceMeasurement": _ILLUMINANCE_MEASUREMENT_CLUSTER_INFO, "KeypadInput": _KEYPAD_INPUT_CLUSTER_INFO, "LevelControl": _LEVEL_CONTROL_CLUSTER_INFO, "LowPower": _LOW_POWER_CLUSTER_INFO, @@ -5886,6 +5927,27 @@ def ClusterIdentify_ReadAttributeIdentifyType(self, device: ctypes.c_void_p, ZCL def ClusterIdentify_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_Identify_ClusterRevision(device, ZCLendpoint, ZCLgroupid) + def ClusterIlluminanceMeasurement_ReadAttributeMeasuredValue(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_MeasuredValue(device, ZCLendpoint, ZCLgroupid) + + def ClusterIlluminanceMeasurement_SubscribeAttributeMeasuredValue(self, device: ctypes.c_void_p, ZCLendpoint: int, minInterval: int, maxInterval: int): + return self._chipLib.chip_ime_SubscribeAttribute_IlluminanceMeasurement_MeasuredValue(device, ZCLendpoint, minInterval, maxInterval) + + def ClusterIlluminanceMeasurement_ReadAttributeMinMeasuredValue(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_MinMeasuredValue(device, ZCLendpoint, ZCLgroupid) + + def ClusterIlluminanceMeasurement_ReadAttributeMaxMeasuredValue(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_MaxMeasuredValue(device, ZCLendpoint, ZCLgroupid) + + def ClusterIlluminanceMeasurement_ReadAttributeTolerance(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_Tolerance(device, ZCLendpoint, ZCLgroupid) + + def ClusterIlluminanceMeasurement_ReadAttributeLightSensorType(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_LightSensorType(device, ZCLendpoint, ZCLgroupid) + + def ClusterIlluminanceMeasurement_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_ClusterRevision(device, ZCLendpoint, ZCLgroupid) + def ClusterKeypadInput_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_KeypadInput_ClusterRevision(device, ZCLendpoint, ZCLgroupid) @@ -8085,6 +8147,35 @@ def InitLib(self, chipLib): self._chipLib.chip_ime_ReadAttribute_Identify_ClusterRevision.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_Identify_ClusterRevision.restype = ctypes.c_uint32 + # Cluster IlluminanceMeasurement + # Cluster IlluminanceMeasurement ReadAttribute MeasuredValue + self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_MeasuredValue.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_MeasuredValue.restype = ctypes.c_uint32 + # Cluster IlluminanceMeasurement SubscribeAttribute MeasuredValue + self._chipLib.chip_ime_SubscribeAttribute_IlluminanceMeasurement_MeasuredValue.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16] + self._chipLib.chip_ime_SubscribeAttribute_IlluminanceMeasurement_MeasuredValue.restype = ctypes.c_uint32 + # Cluster IlluminanceMeasurement ReadAttribute MinMeasuredValue + self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_MinMeasuredValue.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_MinMeasuredValue.restype = ctypes.c_uint32 + # Cluster IlluminanceMeasurement ReadAttribute MaxMeasuredValue + self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_MaxMeasuredValue.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_MaxMeasuredValue.restype = ctypes.c_uint32 + # Cluster IlluminanceMeasurement ReadAttribute Tolerance + self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_Tolerance.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_Tolerance.restype = ctypes.c_uint32 + # Cluster IlluminanceMeasurement ReadAttribute LightSensorType + self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_LightSensorType.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_LightSensorType.restype = ctypes.c_uint32 + # Cluster IlluminanceMeasurement ReadAttribute ClusterRevision + self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_ClusterRevision.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_IlluminanceMeasurement_ClusterRevision.restype = ctypes.c_uint32 # Cluster KeypadInput # Cluster KeypadInput Command SendKey self._chipLib.chip_ime_AppendCommand_KeypadInput_SendKey.argtypes = [ diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 3dbd652af37e92..e87048ca1e3beb 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -14230,6 +14230,11 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class IlluminanceMeasurement: id: typing.ClassVar[int] = 0x0400 + class Enums: + class LightSensorType(IntEnum): + kPhotodiode = 0x00 + kCmos = 0x01 + class Attributes: class MeasuredValue(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -14323,77 +14328,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: return ClusterObjectFieldDescriptor(Type=uint) -@dataclass -class IlluminanceLevelSensing: - id: typing.ClassVar[int] = 0x0401 - - class Attributes: - class LevelStatus(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0401 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - class LightSensorType(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0401 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0001 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - class IlluminanceLevelTarget(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0401 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0010 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - class FeatureMap(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0401 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0xFFFC - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - class ClusterRevision(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0401 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0xFFFD - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - @dataclass class TemperatureMeasurement: id: typing.ClassVar[int] = 0x0402 diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 0582d0ef0f6f76..d9091f7281f8a0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -904,6 +904,30 @@ NS_ASSUME_NONNULL_BEGIN @end +/** + * Cluster Illuminance Measurement + * + */ +@interface CHIPIlluminanceMeasurement : CHIPCluster + +- (void)readAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)subscribeAttributeMeasuredValueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeMinMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeMaxMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeToleranceWithResponseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeLightSensorTypeWithResponseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; + +@end + /** * Cluster Keypad Input * diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 6d74b68c03638f..818a4550d8c6bf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -2626,6 +2626,76 @@ new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Can @end +@implementation CHIPIlluminanceMeasurement + +- (chip::Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)readAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeMeasuredValue(success, failure); + }); +} + +- (void)subscribeAttributeMeasuredValueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.SubscribeAttributeMeasuredValue(success, failure, minInterval, maxInterval); + }); +} + +- (void)reportAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge( + self.callbackQueue, responseHandler, + ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReportAttributeMeasuredValue(success); + }, + true); +} + +- (void)readAttributeMinMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeMinMeasuredValue(success, failure); + }); +} + +- (void)readAttributeMaxMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeMaxMeasuredValue(success, failure); + }); +} + +- (void)readAttributeToleranceWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeTolerance(success, failure); + }); +} + +- (void)readAttributeLightSensorTypeWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeLightSensorType(success, failure); + }); +} + +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeClusterRevision(success, failure); + }); +} + +@end + @implementation CHIPKeypadInput - (chip::Controller::ClusterBase *)getCluster diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h index fe2dfffa5bb3aa..7b0ae929a0412b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h @@ -125,6 +125,10 @@ @property (readonly) chip::Controller::IdentifyCluster cppCluster; @end +@interface CHIPIlluminanceMeasurement () +@property (readonly) chip::Controller::IlluminanceMeasurementCluster cppCluster; +@end + @interface CHIPKeypadInput () @property (readonly) chip::Controller::KeypadInputCluster cppCluster; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h index a6e3f0f01ba989..7c7624578b3b1d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h @@ -397,6 +397,21 @@ NS_ASSUME_NONNULL_BEGIN @end +/** + * Cluster Illuminance Measurement + * + */ +@interface CHIPTestIlluminanceMeasurement : CHIPIlluminanceMeasurement + +- (void)writeAttributeMeasuredValueWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeMinMeasuredValueWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeMaxMeasuredValueWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeToleranceWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeLightSensorTypeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeClusterRevisionWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; + +@end + /** * Cluster Keypad Input * diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index 453f00dff8143f..cfd09b00558f23 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -1353,6 +1353,61 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc @end +@interface CHIPTestIlluminanceMeasurement () +@property (readonly) chip::Controller::IlluminanceMeasurementClusterTest cppCluster; +@end + +@implementation CHIPTestIlluminanceMeasurement + +- (chip::Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)writeAttributeMeasuredValueWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeMeasuredValue(success, failure, value); + }); +} + +- (void)writeAttributeMinMeasuredValueWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeMinMeasuredValue(success, failure, value); + }); +} + +- (void)writeAttributeMaxMeasuredValueWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeMaxMeasuredValue(success, failure, value); + }); +} + +- (void)writeAttributeToleranceWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeTolerance(success, failure, value); + }); +} + +- (void)writeAttributeLightSensorTypeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeLightSensorType(success, failure, value); + }); +} + +- (void)writeAttributeClusterRevisionWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeClusterRevision(success, failure, value); + }); +} + +@end + @interface CHIPTestKeypadInput () @property (readonly) chip::Controller::KeypadInputClusterTest cppCluster; @end diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index d4a1b8924525a2..38273012dfa41c 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -15555,6 +15555,120 @@ - (void)testSendClusterIdentifyReadAttributeClusterRevisionWithResponseHandler [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterIlluminanceMeasurementReadAttributeMeasuredValueWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeMeasuredValueWithResponseHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"IlluminanceMeasurement MeasuredValue Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterIlluminanceMeasurementReadAttributeMinMeasuredValueWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeMinMeasuredValueWithResponseHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMinMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"IlluminanceMeasurement MinMeasuredValue Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterIlluminanceMeasurementReadAttributeMaxMeasuredValueWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeMaxMeasuredValueWithResponseHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMaxMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"IlluminanceMeasurement MaxMeasuredValue Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterIlluminanceMeasurementReadAttributeToleranceWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeToleranceWithResponseHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeToleranceWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"IlluminanceMeasurement Tolerance Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterIlluminanceMeasurementReadAttributeLightSensorTypeWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeLightSensorTypeWithResponseHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeLightSensorTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"IlluminanceMeasurement LightSensorType Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterIlluminanceMeasurementReadAttributeClusterRevisionWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeClusterRevisionWithResponseHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"IlluminanceMeasurement ClusterRevision Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterKeypadInputReadAttributeClusterRevisionWithResponseHandler { XCTestExpectation * expectation = diff --git a/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h index a907c55b7876a3..ea79a344ba528d 100644 --- a/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h @@ -49,6 +49,7 @@ MatterGroupsPluginServerInitCallback(); \ MatterIasZonePluginServerInitCallback(); \ MatterIdentifyPluginServerInitCallback(); \ + MatterIlluminanceMeasurementPluginServerInitCallback(); \ MatterKeypadInputPluginServerInitCallback(); \ MatterLevelControlPluginServerInitCallback(); \ MatterLowPowerPluginServerInitCallback(); \ diff --git a/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp b/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp index 64743735f8d41b..477fcaed26cbc1 100644 --- a/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp @@ -110,6 +110,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_IDENTIFY_CLUSTER_ID: emberAfIdentifyClusterInitCallback(endpoint); break; + case ZCL_ILLUMINANCE_MEASUREMENT_CLUSTER_ID: + emberAfIlluminanceMeasurementClusterInitCallback(endpoint); + break; case ZCL_KEYPAD_INPUT_CLUSTER_ID: emberAfKeypadInputClusterInitCallback(endpoint); break; @@ -338,6 +341,11 @@ void __attribute__((weak)) emberAfIdentifyClusterInitCallback(EndpointId endpoin // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfIlluminanceMeasurementClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfKeypadInputClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 606162da921786..df9dd23cabca0e 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -2087,7 +2087,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 473 +#define GENERATED_ATTRIBUTE_COUNT 479 #define GENERATED_ATTRIBUTES \ { \ \ @@ -2547,6 +2547,14 @@ ZAP_EMPTY_DEFAULT() }, /* start up color temperature mireds */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ + /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ + { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* MeasuredValue */ \ + { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinMeasuredValue */ \ + { 0x0002, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxMeasuredValue */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Tolerance */ \ + { 0x0004, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* LightSensorType */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ + \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* measured value */ \ { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* min measured value */ \ @@ -2772,7 +2780,7 @@ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 62 +#define GENERATED_CLUSTER_COUNT 63 #define GENERATED_CLUSTERS \ { \ { 0x0003, \ @@ -2940,83 +2948,86 @@ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(357), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0400, ZAP_ATTRIBUTE_INDEX(357), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ + { \ + 0x0402, ZAP_ATTRIBUTE_INDEX(363), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(361), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(367), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(365), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(371), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(369), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(375), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(373), \ + ZAP_ATTRIBUTE_INDEX(379), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(377), \ + ZAP_ATTRIBUTE_INDEX(383), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(383), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(389), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(385), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(391), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: TV Channel (server) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(389), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(395), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(391), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(397), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(400), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(406), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(403), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(409), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(404), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(410), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(405), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(411), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(408), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(414), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(411), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(417), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(415), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(421), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(423), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(429), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(424), 25, 2607, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(430), 25, 2607, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(449), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(455), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(461), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(467), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(462), \ + ZAP_ATTRIBUTE_INDEX(468), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(469), \ + ZAP_ATTRIBUTE_INDEX(475), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3028,7 +3039,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 18, 3376 }, { ZAP_CLUSTER_INDEX(18), 42, 7534 }, { ZAP_CLUSTER_INDEX(60), 2, 18 }, \ + { ZAP_CLUSTER_INDEX(0), 18, 3376 }, { ZAP_CLUSTER_INDEX(18), 43, 7545 }, { ZAP_CLUSTER_INDEX(61), 2, 18 }, \ } // Largest attribute size is needed for various buffers @@ -3038,7 +3049,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (1518) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (10928) +#define ATTRIBUTE_MAX_SIZE (10939) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/all-clusters-app/zap-generated/gen_config.h b/zzz_generated/all-clusters-app/zap-generated/gen_config.h index bd8b91850c4fec..8a5985624352cf 100644 --- a/zzz_generated/all-clusters-app/zap-generated/gen_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/gen_config.h @@ -56,6 +56,7 @@ #define EMBER_AF_GROUPS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_IAS_ZONE_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT (2) +#define EMBER_AF_ILLUMINANCE_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_KEYPAD_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_LOW_POWER_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -229,6 +230,11 @@ #define EMBER_AF_PLUGIN_IDENTIFY_SERVER #define EMBER_AF_PLUGIN_IDENTIFY +// Use this macro to check if the server side of the Illuminance Measurement cluster is included +#define ZCL_USING_ILLUMINANCE_MEASUREMENT_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_ILLUMINANCE_MEASUREMENT_SERVER +#define EMBER_AF_PLUGIN_ILLUMINANCE_MEASUREMENT + // Use this macro to check if the server side of the Keypad Input cluster is included #define ZCL_USING_KEYPAD_INPUT_CLUSTER_SERVER #define EMBER_AF_PLUGIN_KEYPAD_INPUT_SERVER diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index 308079962b0444..dbb33e8f579fb1 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -855,16 +855,7 @@ #define ZCL_ILLUM_MIN_MEASURED_VALUE_ATTRIBUTE_ID (0x0001) #define ZCL_ILLUM_MAX_MEASURED_VALUE_ATTRIBUTE_ID (0x0002) #define ZCL_ILLUM_TOLERANCE_ATTRIBUTE_ID (0x0003) -#define ZCL_MEASUREMENT_LIGHT_SENSOR_TYPE_ATTRIBUTE_ID (0x0004) - -// Attribute ids for cluster: Illuminance Level Sensing - -// Client attributes - -// Server attributes -#define ZCL_LEVEL_STATUS_ATTRIBUTE_ID (0x0000) -#define ZCL_SENSING_LIGHT_SENSOR_TYPE_ATTRIBUTE_ID (0x0001) -#define ZCL_ILLUMINANCE_TARGET_LEVEL_ATTRIBUTE_ID (0x0010) +#define ZCL_ILLUM_LIGHT_SENSOR_TYPE_ATTRIBUTE_ID (0x0004) // Attribute ids for cluster: Temperature Measurement 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 e07e22146b680a..013f54a4571f0f 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 @@ -7292,57 +7292,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lightSensorType) } // namespace Attributes } // namespace IlluminanceMeasurement -namespace IlluminanceLevelSensing { -namespace Attributes { - -namespace LevelStatus { - -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * levelStatus) -{ - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceLevelSensing::Id, Id, (uint8_t *) levelStatus, - sizeof(*levelStatus)); -} -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t levelStatus) -{ - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceLevelSensing::Id, Id, (uint8_t *) &levelStatus, - ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace LevelStatus - -namespace LightSensorType { - -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * lightSensorType) -{ - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceLevelSensing::Id, Id, (uint8_t *) lightSensorType, - sizeof(*lightSensorType)); -} -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lightSensorType) -{ - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceLevelSensing::Id, Id, (uint8_t *) &lightSensorType, - ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace LightSensorType - -namespace IlluminanceLevelTarget { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * illuminanceLevelTarget) -{ - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceLevelSensing::Id, Id, (uint8_t *) illuminanceLevelTarget, - sizeof(*illuminanceLevelTarget)); -} -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t illuminanceLevelTarget) -{ - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceLevelSensing::Id, Id, (uint8_t *) &illuminanceLevelTarget, - ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace IlluminanceLevelTarget - -} // namespace Attributes -} // namespace IlluminanceLevelSensing - namespace TemperatureMeasurement { 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 fe7c09b477e468..6d822b1d90643e 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 @@ -2683,27 +2683,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lightSensorType); } // namespace Attributes } // namespace IlluminanceMeasurement -namespace IlluminanceLevelSensing { -namespace Attributes { - -namespace LevelStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * levelStatus); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t levelStatus); -} // namespace LevelStatus - -namespace LightSensorType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * lightSensorType); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lightSensorType); -} // namespace LightSensorType - -namespace IlluminanceLevelTarget { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * illuminanceLevelTarget); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t illuminanceLevelTarget); -} // namespace IlluminanceLevelTarget - -} // namespace Attributes -} // namespace IlluminanceLevelSensing - namespace TemperatureMeasurement { 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 2c2a5d9897b46f..95de7643a35a0b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -414,14 +414,6 @@ void emberAfBallastConfigurationClusterInitCallback(chip::EndpointId endpoint); */ void emberAfIlluminanceMeasurementClusterInitCallback(chip::EndpointId endpoint); -/** @brief Illuminance Level Sensing Cluster Init - * - * Cluster Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfIlluminanceLevelSensingClusterInitCallback(chip::EndpointId endpoint); - /** @brief Temperature Measurement Cluster Init * * Cluster Init @@ -5712,110 +5704,6 @@ void emberAfIlluminanceMeasurementClusterServerTickCallback(chip::EndpointId end */ void emberAfIlluminanceMeasurementClusterClientTickCallback(chip::EndpointId endpoint); -// -// Illuminance Level Sensing Cluster -// - -/** @brief Illuminance Level Sensing Cluster Server Init - * - * Server Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfIlluminanceLevelSensingClusterServerInitCallback(chip::EndpointId endpoint); - -/** @brief Illuminance Level Sensing Cluster Client Init - * - * Client Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfIlluminanceLevelSensingClusterClientInitCallback(chip::EndpointId endpoint); - -/** @brief Illuminance Level Sensing Cluster Server Attribute Changed - * - * Server Attribute Changed - * - * @param attributePath Concrete attribute path that changed - */ -void MatterIlluminanceLevelSensingClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); - -/** @brief Illuminance Level Sensing Cluster Client Attribute Changed - * - * Client Attribute Changed - * - * @param attributePath Concrete attribute path that changed - */ -void MatterIlluminanceLevelSensingClusterClientAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); - -/** @brief Illuminance Level Sensing Cluster Server Message Sent - * - * Server Message Sent - * - * @param destination The destination to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfIlluminanceLevelSensingClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); - -/** @brief Illuminance Level Sensing Cluster Client Message Sent - * - * Client Message Sent - * - * @param destination The destination to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfIlluminanceLevelSensingClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); - -/** @brief Illuminance Level Sensing 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 MatterIlluminanceLevelSensingClusterServerPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); - -/** @brief Illuminance Level Sensing 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 MatterIlluminanceLevelSensingClusterClientPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); - -/** @brief Illuminance Level Sensing Cluster Server Tick - * - * Server Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfIlluminanceLevelSensingClusterServerTickCallback(chip::EndpointId endpoint); - -/** @brief Illuminance Level Sensing Cluster Client Tick - * - * Client Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfIlluminanceLevelSensingClusterClientTickCallback(chip::EndpointId endpoint); - // // Temperature Measurement Cluster // diff --git a/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h b/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h index dd5240b33691c4..c50da586139b02 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h +++ b/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h @@ -157,9 +157,6 @@ void __attribute__((weak)) MatterBallastConfigurationPluginServerInitCallback(){ void __attribute__((weak)) MatterIlluminanceMeasurementPluginClientInitCallback(){}; void __attribute__((weak)) MatterIlluminanceMeasurementPluginServerInitCallback(){}; -void __attribute__((weak)) MatterIlluminanceLevelSensingPluginClientInitCallback(){}; -void __attribute__((weak)) MatterIlluminanceLevelSensingPluginServerInitCallback(){}; - void __attribute__((weak)) MatterTemperatureMeasurementPluginClientInitCallback(){}; void __attribute__((weak)) MatterTemperatureMeasurementPluginServerInitCallback(){}; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-id.h b/zzz_generated/app-common/app-common/zap-generated/cluster-id.h index 081c32e27d5f62..d6ef5d57cbb968 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-id.h @@ -158,10 +158,7 @@ static constexpr chip::ClusterId ZCL_COLOR_CONTROL_CLUSTER_ID = 0x0300; static constexpr chip::ClusterId ZCL_BALLAST_CONFIGURATION_CLUSTER_ID = 0x0301; // Definitions for cluster: Illuminance Measurement -static constexpr chip::ClusterId ZCL_ILLUM_MEASUREMENT_CLUSTER_ID = 0x0400; - -// Definitions for cluster: Illuminance Level Sensing -static constexpr chip::ClusterId ZCL_ILLUM_LEVEL_SENSING_CLUSTER_ID = 0x0401; +static constexpr chip::ClusterId ZCL_ILLUMINANCE_MEASUREMENT_CLUSTER_ID = 0x0400; // Definitions for cluster: Temperature Measurement static constexpr chip::ClusterId ZCL_TEMP_MEASUREMENT_CLUSTER_ID = 0x0402; 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 5088b6e6ca14ff..34eacda0fde5de 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 @@ -11869,15 +11869,6 @@ namespace Events { } // namespace Events } // namespace IlluminanceMeasurement -namespace IlluminanceLevelSensing { - -namespace Commands { -} // namespace Commands - -namespace Events { -} // namespace Events - -} // namespace IlluminanceLevelSensing namespace TemperatureMeasurement { namespace Commands { 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 98d85d95ccc378..7d67950adae675 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 @@ -16739,6 +16739,18 @@ struct TypeInfo } // namespace Attributes } // namespace BallastConfiguration namespace IlluminanceMeasurement { +// Need to convert consumers to using the new enum classes, so we +// don't just have casts all over. +#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM +// Enum for LightSensorType +enum class LightSensorType : uint8_t +{ + kPhotodiode = 0x00, + kCmos = 0x01, +}; +#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM +using LightSensorType = EmberAfLightSensorType; +#endif namespace Attributes { namespace MeasuredValue { @@ -16813,61 +16825,6 @@ struct TypeInfo } // namespace ClusterRevision } // namespace Attributes } // namespace IlluminanceMeasurement -namespace IlluminanceLevelSensing { - -namespace Attributes { -namespace LevelStatus { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceLevelSensing::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::LevelStatus::Id; } -}; -} // namespace LevelStatus -namespace LightSensorType { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceLevelSensing::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::LightSensorType::Id; } -}; -} // namespace LightSensorType -namespace IlluminanceLevelTarget { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceLevelSensing::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::IlluminanceLevelTarget::Id; } -}; -} // namespace IlluminanceLevelTarget -namespace FeatureMap { -struct TypeInfo -{ - using Type = uint32_t; - using DecodableType = uint32_t; - - static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceLevelSensing::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::FeatureMap::Id; } -}; -} // namespace FeatureMap -namespace ClusterRevision { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceLevelSensing::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ClusterRevision::Id; } -}; -} // namespace ClusterRevision -} // namespace Attributes -} // namespace IlluminanceLevelSensing namespace TemperatureMeasurement { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h index 44e1bae57b0b70..98ebd58c65bebf 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -982,6 +982,13 @@ enum EmberAfLevelStatus : uint8_t EMBER_ZCL_LEVEL_STATUS_ABOVE_TARGET = 2, }; +// Enum for LightSensorType +enum EmberAfLightSensorType : uint8_t +{ + EMBER_ZCL_LIGHT_SENSOR_TYPE_PHOTODIODE = 0, + EMBER_ZCL_LIGHT_SENSOR_TYPE_CMOS = 1, +}; + // Enum for LogsIntent enum EmberAfLogsIntent : uint8_t { @@ -1007,13 +1014,6 @@ enum EmberAfLogsTransferProtocol : uint8_t EMBER_ZCL_LOGS_TRANSFER_PROTOCOL_BDX = 1, }; -// Enum for MeasurementLightSensorType -enum EmberAfMeasurementLightSensorType : uint8_t -{ - EMBER_ZCL_MEASUREMENT_LIGHT_SENSOR_TYPE_PHOTODIODE = 0, - EMBER_ZCL_MEASUREMENT_LIGHT_SENSOR_TYPE_CMOS = 1, -}; - // Enum for MediaInputType enum EmberAfMediaInputType : uint8_t { @@ -1424,13 +1424,6 @@ enum EmberAfSecurityType : uint8_t EMBER_ZCL_SECURITY_TYPE_WPA3 = 5, }; -// Enum for SensingLightSensorType -enum EmberAfSensingLightSensorType : uint8_t -{ - EMBER_ZCL_SENSING_LIGHT_SENSOR_TYPE_PHOTODIODE = 0, - EMBER_ZCL_SENSING_LIGHT_SENSOR_TYPE_CMOS = 1, -}; - // Enum for SetpointAdjustMode enum EmberAfSetpointAdjustMode : uint8_t { 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 42ab85dcf51964..f2d9a0a13143d5 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 @@ -2903,32 +2903,6 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace IlluminanceMeasurement -namespace IlluminanceLevelSensing { -namespace Attributes { - -namespace LevelStatus { -static constexpr AttributeId Id = 0x00000000; -} // namespace LevelStatus - -namespace LightSensorType { -static constexpr AttributeId Id = 0x00000001; -} // namespace LightSensorType - -namespace IlluminanceLevelTarget { -static constexpr AttributeId Id = 0x00000010; -} // namespace IlluminanceLevelTarget - -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 IlluminanceLevelSensing - namespace TemperatureMeasurement { 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 f4660273a34967..e24a0459275ea3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -163,9 +163,6 @@ static constexpr ClusterId Id = 0x00000301; namespace IlluminanceMeasurement { static constexpr ClusterId Id = 0x00000400; } // namespace IlluminanceMeasurement -namespace IlluminanceLevelSensing { -static constexpr ClusterId Id = 0x00000401; -} // namespace IlluminanceLevelSensing namespace TemperatureMeasurement { static constexpr ClusterId Id = 0x00000402; } // namespace TemperatureMeasurement 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 cc498c063779ff..fdee6c771a5166 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 @@ -299,16 +299,11 @@ #define CHIP_PRINTCLUSTER_BALLAST_CONFIGURATION_CLUSTER #endif -#if defined(ZCL_USING_ILLUM_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_ILLUM_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ILLUM_MEASUREMENT_CLUSTER { ZCL_ILLUM_MEASUREMENT_CLUSTER_ID, 1024, "Illuminance Measurement" }, +#if defined(ZCL_USING_ILLUMINANCE_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_ILLUMINANCE_MEASUREMENT_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_ILLUMINANCE_MEASUREMENT_CLUSTER \ + { ZCL_ILLUMINANCE_MEASUREMENT_CLUSTER_ID, 1024, "Illuminance Measurement" }, #else -#define CHIP_PRINTCLUSTER_ILLUM_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_ILLUM_LEVEL_SENSING_CLUSTER_SERVER) || defined(ZCL_USING_ILLUM_LEVEL_SENSING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ILLUM_LEVEL_SENSING_CLUSTER { ZCL_ILLUM_LEVEL_SENSING_CLUSTER_ID, 1025, "Illuminance Level Sensing" }, -#else -#define CHIP_PRINTCLUSTER_ILLUM_LEVEL_SENSING_CLUSTER +#define CHIP_PRINTCLUSTER_ILLUMINANCE_MEASUREMENT_CLUSTER #endif #if defined(ZCL_USING_TEMP_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_TEMP_MEASUREMENT_CLUSTER_CLIENT) @@ -789,8 +784,7 @@ CHIP_PRINTCLUSTER_THERMOSTAT_UI_CONFIG_CLUSTER \ CHIP_PRINTCLUSTER_COLOR_CONTROL_CLUSTER \ CHIP_PRINTCLUSTER_BALLAST_CONFIGURATION_CLUSTER \ - CHIP_PRINTCLUSTER_ILLUM_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_ILLUM_LEVEL_SENSING_CLUSTER \ + CHIP_PRINTCLUSTER_ILLUMINANCE_MEASUREMENT_CLUSTER \ CHIP_PRINTCLUSTER_TEMP_MEASUREMENT_CLUSTER \ CHIP_PRINTCLUSTER_PRESSURE_MEASUREMENT_CLUSTER \ CHIP_PRINTCLUSTER_FLOW_MEASUREMENT_CLUSTER \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 23c78e82c95ca6..c2fe09494bad2a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -1916,6 +1916,7 @@ static void OnTestClusterTestSpecificResponseSuccess( | GroupKeyManagement | 0xF004 | | Groups | 0x0004 | | Identify | 0x0003 | +| IlluminanceMeasurement | 0x0400 | | KeypadInput | 0x0509 | | LevelControl | 0x0008 | | LowPower | 0x0508 | @@ -11784,6 +11785,270 @@ class ReadIdentifyClusterRevision : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; +/*----------------------------------------------------------------------------*\ +| Cluster IlluminanceMeasurement | 0x0400 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeasuredValue | 0x0000 | +| * MinMeasuredValue | 0x0001 | +| * MaxMeasuredValue | 0x0002 | +| * Tolerance | 0x0003 | +| * LightSensorType | 0x0004 | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute MeasuredValue + */ +class ReadIlluminanceMeasurementMeasuredValue : public ModelCommand +{ +public: + ReadIlluminanceMeasurementMeasuredValue() : ModelCommand("read") + { + AddArgument("attr-name", "measured-value"); + ModelCommand::AddArguments(); + } + + ~ReadIlluminanceMeasurementMeasuredValue() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0400) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class ReportIlluminanceMeasurementMeasuredValue : public ModelCommand +{ +public: + ReportIlluminanceMeasurementMeasuredValue() : ModelCommand("report") + { + AddArgument("attr-name", "measured-value"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + ModelCommand::AddArguments(); + } + + ~ReportIlluminanceMeasurementMeasuredValue() + { + delete onSuccessCallback; + delete onFailureCallback; + delete onReportCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0400) command (0x06) on endpoint %" PRIu8, endpointId); + + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, endpointId); + + CHIP_ERROR err = cluster.ReportAttributeMeasuredValue(onReportCallback->Cancel()); + if (err != CHIP_NO_ERROR) + { + return err; + } + + return cluster.SubscribeAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval, + mMaxInterval); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + uint16_t mMinInterval; + uint16_t mMaxInterval; +}; + +/* + * Attribute MinMeasuredValue + */ +class ReadIlluminanceMeasurementMinMeasuredValue : public ModelCommand +{ +public: + ReadIlluminanceMeasurementMinMeasuredValue() : ModelCommand("read") + { + AddArgument("attr-name", "min-measured-value"); + ModelCommand::AddArguments(); + } + + ~ReadIlluminanceMeasurementMinMeasuredValue() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0400) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeMinMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Attribute MaxMeasuredValue + */ +class ReadIlluminanceMeasurementMaxMeasuredValue : public ModelCommand +{ +public: + ReadIlluminanceMeasurementMaxMeasuredValue() : ModelCommand("read") + { + AddArgument("attr-name", "max-measured-value"); + ModelCommand::AddArguments(); + } + + ~ReadIlluminanceMeasurementMaxMeasuredValue() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0400) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeMaxMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Attribute Tolerance + */ +class ReadIlluminanceMeasurementTolerance : public ModelCommand +{ +public: + ReadIlluminanceMeasurementTolerance() : ModelCommand("read") + { + AddArgument("attr-name", "tolerance"); + ModelCommand::AddArguments(); + } + + ~ReadIlluminanceMeasurementTolerance() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0400) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeTolerance(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Attribute LightSensorType + */ +class ReadIlluminanceMeasurementLightSensorType : public ModelCommand +{ +public: + ReadIlluminanceMeasurementLightSensorType() : ModelCommand("read") + { + AddArgument("attr-name", "light-sensor-type"); + ModelCommand::AddArguments(); + } + + ~ReadIlluminanceMeasurementLightSensorType() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0400) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeLightSensorType(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Attribute ClusterRevision + */ +class ReadIlluminanceMeasurementClusterRevision : public ModelCommand +{ +public: + ReadIlluminanceMeasurementClusterRevision() : ModelCommand("read") + { + AddArgument("attr-name", "cluster-revision"); + ModelCommand::AddArguments(); + } + + ~ReadIlluminanceMeasurementClusterRevision() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0400) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + /*----------------------------------------------------------------------------*\ | Cluster KeypadInput | 0x0509 | |------------------------------------------------------------------------------| @@ -26548,6 +26813,22 @@ void registerClusterIdentify(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterIlluminanceMeasurement(Commands & commands) +{ + const char * clusterName = "IlluminanceMeasurement"; + + commands_list clusterCommands = { + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterKeypadInput(Commands & commands) { const char * clusterName = "KeypadInput"; @@ -27258,6 +27539,7 @@ void registerClusters(Commands & commands) registerClusterGroupKeyManagement(commands); registerClusterGroups(commands); registerClusterIdentify(commands); + registerClusterIlluminanceMeasurement(commands); registerClusterKeypadInput(commands); registerClusterLevelControl(commands); registerClusterLowPower(commands); diff --git a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h index 2e713a7d7ce1b0..9453b5dc06ce30 100644 --- a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h @@ -39,6 +39,7 @@ class Listen : public ReportingCommand delete onReportColorControlCurrentYCallback; delete onReportColorControlColorTemperatureCallback; delete onReportDoorLockLockStateCallback; + delete onReportIlluminanceMeasurementMeasuredValueCallback; delete onReportLevelControlCurrentLevelCallback; delete onReportOccupancySensingOccupancyCallback; delete onReportOnOffOnOffCallback; @@ -81,6 +82,9 @@ class Listen : public ReportingCommand BasicAttributeFilter); callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0x0000, onReportDoorLockLockStateCallback->Cancel(), BasicAttributeFilter); + callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0400, 0x0000, + onReportIlluminanceMeasurementMeasuredValueCallback->Cancel(), + BasicAttributeFilter); callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0000, onReportLevelControlCurrentLevelCallback->Cancel(), BasicAttributeFilter); callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0406, 0x0000, onReportOccupancySensingOccupancyCallback->Cancel(), @@ -182,6 +186,8 @@ class Listen : public ReportingCommand new chip::Callback::Callback(OnInt16uAttributeResponse, this); chip::Callback::Callback * onReportDoorLockLockStateCallback = new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onReportIlluminanceMeasurementMeasuredValueCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); chip::Callback::Callback * onReportLevelControlCurrentLevelCallback = new chip::Callback::Callback(OnInt8uAttributeResponse, this); chip::Callback::Callback * onReportOccupancySensingOccupancyCallback = diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp index 61e887b1bde501..505b09b8896a69 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp @@ -6914,6 +6914,98 @@ ClusterBase::InvokeCommand, CommandResponseFailureCallback); +// IlluminanceMeasurement Cluster Commands +// IlluminanceMeasurement Cluster Attributes +CHIP_ERROR IlluminanceMeasurementCluster::ReadAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000000; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR IlluminanceMeasurementCluster::SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval) +{ + chip::app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = IlluminanceMeasurement::Attributes::MeasuredValue::Id; + attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR IlluminanceMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) +{ + return RequestAttributeReporting(IlluminanceMeasurement::Attributes::MeasuredValue::Id, onReportCallback, + BasicAttributeFilter); +} + +CHIP_ERROR IlluminanceMeasurementCluster::ReadAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000001; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR IlluminanceMeasurementCluster::ReadAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000002; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR IlluminanceMeasurementCluster::ReadAttributeTolerance(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000003; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR IlluminanceMeasurementCluster::ReadAttributeLightSensorType(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000004; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR IlluminanceMeasurementCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x0000FFFD; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + // KeypadInput Cluster Commands CHIP_ERROR KeypadInputCluster::SendKey(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t keyCode) diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index 3bf3a3892bc711..99751ce175c039 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -754,6 +754,24 @@ class DLL_EXPORT IdentifyCluster : public ClusterBase private: }; +class DLL_EXPORT IlluminanceMeasurementCluster : public ClusterBase +{ +public: + IlluminanceMeasurementCluster() : ClusterBase(app::Clusters::IlluminanceMeasurement::Id) {} + ~IlluminanceMeasurementCluster() {} + + // Cluster Attributes + CHIP_ERROR ReadAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeLightSensorType(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval); + CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); +}; + class DLL_EXPORT KeypadInputCluster : public ClusterBase { public: diff --git a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h index e9571a75947e51..3e973ebd8b1754 100644 --- a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h @@ -48,6 +48,7 @@ MatterGroupKeyManagementPluginClientInitCallback(); \ MatterGroupsPluginClientInitCallback(); \ MatterIdentifyPluginClientInitCallback(); \ + MatterIlluminanceMeasurementPluginClientInitCallback(); \ MatterKeypadInputPluginClientInitCallback(); \ MatterLevelControlPluginClientInitCallback(); \ MatterLowPowerPluginClientInitCallback(); \ diff --git a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp index bd687e9051db71..4ffb3341c0e650 100644 --- a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp +++ b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp @@ -107,6 +107,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_IDENTIFY_CLUSTER_ID: emberAfIdentifyClusterInitCallback(endpoint); break; + case ZCL_ILLUMINANCE_MEASUREMENT_CLUSTER_ID: + emberAfIlluminanceMeasurementClusterInitCallback(endpoint); + break; case ZCL_KEYPAD_INPUT_CLUSTER_ID: emberAfKeypadInputClusterInitCallback(endpoint); break; @@ -330,6 +333,11 @@ void __attribute__((weak)) emberAfIdentifyClusterInitCallback(EndpointId endpoin // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfIlluminanceMeasurementClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfKeypadInputClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h index 2878ea159f91c1..bec3796716c8ef 100644 --- a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h @@ -73,7 +73,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 55 +#define GENERATED_ATTRIBUTE_COUNT 56 #define GENERATED_ATTRIBUTES \ { \ \ @@ -179,6 +179,9 @@ /* Endpoint: 1, Cluster: Color Control (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ + /* Endpoint: 1, Cluster: Illuminance Measurement (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ + \ /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ @@ -250,7 +253,7 @@ #define GENERATED_FUNCTION_ARRAYS #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 55 +#define GENERATED_CLUSTER_COUNT 56 #define GENERATED_CLUSTERS \ { \ { 0x0003, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Identify (client) */ \ @@ -344,67 +347,70 @@ 0x0300, ZAP_ATTRIBUTE_INDEX(33), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Color Control (client) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(34), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0400, ZAP_ATTRIBUTE_INDEX(34), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Illuminance Measurement (client) */ \ + { \ + 0x0402, ZAP_ATTRIBUTE_INDEX(35), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(35), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(36), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(36), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(37), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (client) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(37), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(38), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (client) */ \ { \ - 0x0406, ZAP_ATTRIBUTE_INDEX(38), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0406, ZAP_ATTRIBUTE_INDEX(39), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Occupancy Sensing (client) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(39), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(40), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (client) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(40), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(41), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: TV Channel (client) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(41), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(42), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (client) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(42), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(43), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (client) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(43), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(44), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Media Input (client) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(44), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(45), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Low Power (client) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(45), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(46), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (client) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(46), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(47), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (client) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(47), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(48), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (client) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(48), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(49), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (client) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(49), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(50), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (client) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(50), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(51), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Account Login (client) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(51), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(52), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (client) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(52), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(53), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (client) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(53), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(54), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Binding (client) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(54), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(55), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Group Key Management (client) */ \ } @@ -413,7 +419,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 55, 112 }, \ + { ZAP_CLUSTER_INDEX(0), 56, 114 }, \ } // Largest attribute size is needed for various buffers @@ -423,7 +429,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (4) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (112) +#define ATTRIBUTE_MAX_SIZE (114) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (1) diff --git a/zzz_generated/controller-clusters/zap-generated/gen_config.h b/zzz_generated/controller-clusters/zap-generated/gen_config.h index ff6380211a0ee8..0c8eba1249f8b1 100644 --- a/zzz_generated/controller-clusters/zap-generated/gen_config.h +++ b/zzz_generated/controller-clusters/zap-generated/gen_config.h @@ -55,6 +55,7 @@ #define EMBER_AF_GROUP_KEY_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_GROUPS_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_IDENTIFY_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_ILLUMINANCE_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_KEYPAD_INPUT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_LEVEL_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_LOW_POWER_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -191,6 +192,10 @@ #define ZCL_USING_IDENTIFY_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_IDENTIFY_CLIENT +// Use this macro to check if the client side of the Illuminance Measurement cluster is included +#define ZCL_USING_ILLUMINANCE_MEASUREMENT_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_ILLUMINANCE_MEASUREMENT_CLIENT + // Use this macro to check if the client side of the Keypad Input cluster is included #define ZCL_USING_KEYPAD_INPUT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_KEYPAD_INPUT_CLIENT diff --git a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp index 7a1bf36aa8fb86..5841fb9bd0d197 100644 --- a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp +++ b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp @@ -1484,6 +1484,70 @@ CHIP_ERROR IdentifyClusterTest::WriteAttributeClusterRevision(Callback::Cancelab return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); } +CHIP_ERROR IlluminanceMeasurementClusterTest::WriteAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, IlluminanceMeasurement::Attributes::MeasuredValue::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} +CHIP_ERROR IlluminanceMeasurementClusterTest::WriteAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, IlluminanceMeasurement::Attributes::MinMeasuredValue::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} +CHIP_ERROR IlluminanceMeasurementClusterTest::WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, IlluminanceMeasurement::Attributes::MaxMeasuredValue::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} +CHIP_ERROR IlluminanceMeasurementClusterTest::WriteAttributeTolerance(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, IlluminanceMeasurement::Attributes::Tolerance::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} +CHIP_ERROR IlluminanceMeasurementClusterTest::WriteAttributeLightSensorType(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, IlluminanceMeasurement::Attributes::LightSensorType::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} +CHIP_ERROR IlluminanceMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, IlluminanceMeasurement::Attributes::ClusterRevision::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + CHIP_ERROR KeypadInputClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value) { diff --git a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h index d8242cfaeffdf9..a7b6d67fa90681 100644 --- a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h +++ b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h @@ -513,6 +513,26 @@ class DLL_EXPORT IdentifyClusterTest : public IdentifyCluster uint16_t value); }; +class DLL_EXPORT IlluminanceMeasurementClusterTest : public IlluminanceMeasurementCluster +{ +public: + IlluminanceMeasurementClusterTest() : IlluminanceMeasurementCluster() {} + ~IlluminanceMeasurementClusterTest() {} + + CHIP_ERROR WriteAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeLightSensorType(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); +}; + class DLL_EXPORT KeypadInputClusterTest : public KeypadInputCluster { public: