From 237784456a22ac51fe00c55179e27c8e58239974 Mon Sep 17 00:00:00 2001
From: riwaghe <108741313+riwaghe@users.noreply.github.com>
Date: Wed, 31 May 2023 08:11:24 +0530
Subject: [PATCH] Bugfix: Mismatch in value type of light-sensor-type attribute
of illuminace measurment cluster (#26290)
---
.../all-clusters-app.matter | 4 +-
.../all-clusters-minimal-app.matter | 2 +-
.../rootnode_lightsensor_lZQycTFcJK.matter | 4 +-
.../placeholder/linux/apps/app1/config.matter | 4 +-
.../placeholder/linux/apps/app2/config.matter | 4 +-
.../chip/illuminance-measurement-cluster.xml | 4 +-
.../data_model/controller-clusters.matter | 4 +-
.../CHIPAttributeTLVValueDecoder.cpp | 2 +-
.../java/zap-generated/CHIPReadCallbacks.cpp | 6 +-
.../python/chip/clusters/Objects.py | 10 +--
.../MTRAttributeTLVValueDecoder.mm | 2 +-
.../CHIP/zap-generated/MTRBaseClusters.h | 6 +-
.../CHIP/zap-generated/MTRBaseClusters.mm | 15 ++--
.../CHIP/zap-generated/MTRCallbackBridge.h | 69 ++++++++++---------
.../CHIP/zap-generated/MTRCallbackBridge.mm | 12 ++--
.../zap-generated/attributes/Accessors.cpp | 14 ++--
.../zap-generated/attributes/Accessors.h | 9 ++-
.../zap-generated/cluster-enums-check.h | 4 +-
.../app-common/zap-generated/cluster-enums.h | 4 +-
.../zap-generated/cluster-objects.h | 7 +-
.../zap-generated/cluster/Commands.h | 7 +-
.../cluster/logging/DataModelLogger.cpp | 2 +-
.../chip-tool/zap-generated/test/Commands.h | 2 +-
23 files changed, 103 insertions(+), 94 deletions(-)
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
index 4ba3c051decf46..1f08b38bae7f45 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
@@ -3710,7 +3710,7 @@ server cluster BallastConfiguration = 769 {
/** Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. */
server cluster IlluminanceMeasurement = 1024 {
- enum LightSensorType : ENUM8 {
+ enum LightSensorTypeEnum : ENUM8 {
kPhotodiode = 0;
kCmos = 1;
}
@@ -3719,7 +3719,7 @@ server cluster IlluminanceMeasurement = 1024 {
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
readonly attribute int16u tolerance = 3;
- readonly attribute nullable enum8 lightSensorType = 4;
+ readonly attribute nullable LightSensorTypeEnum lightSensorType = 4;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
index 5c7c4817015bfc..b4942289beb56c 100644
--- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
+++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
@@ -2948,7 +2948,7 @@ server cluster BallastConfiguration = 769 {
/** Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. */
server cluster IlluminanceMeasurement = 1024 {
- enum LightSensorType : ENUM8 {
+ enum LightSensorTypeEnum : ENUM8 {
kPhotodiode = 0;
kCmos = 1;
}
diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter
index 3820a6ab9047c5..de7b03df8a1fbd 100644
--- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter
+++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter
@@ -1275,7 +1275,7 @@ server cluster FixedLabel = 64 {
/** Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. */
server cluster IlluminanceMeasurement = 1024 {
- enum LightSensorType : ENUM8 {
+ enum LightSensorTypeEnum : ENUM8 {
kPhotodiode = 0;
kCmos = 1;
}
@@ -1283,7 +1283,7 @@ server cluster IlluminanceMeasurement = 1024 {
readonly attribute nullable int16u measuredValue = 0;
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
- readonly attribute nullable enum8 lightSensorType = 4;
+ readonly attribute nullable LightSensorTypeEnum lightSensorType = 4;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter
index ffda88810287a3..9e807c1f1e3056 100644
--- a/examples/placeholder/linux/apps/app1/config.matter
+++ b/examples/placeholder/linux/apps/app1/config.matter
@@ -4953,7 +4953,7 @@ server cluster ColorControl = 768 {
/** Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. */
server cluster IlluminanceMeasurement = 1024 {
- enum LightSensorType : ENUM8 {
+ enum LightSensorTypeEnum : ENUM8 {
kPhotodiode = 0;
kCmos = 1;
}
@@ -4962,7 +4962,7 @@ server cluster IlluminanceMeasurement = 1024 {
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
readonly attribute int16u tolerance = 3;
- readonly attribute nullable enum8 lightSensorType = 4;
+ readonly attribute nullable LightSensorTypeEnum lightSensorType = 4;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter
index 387d171c8d2d14..b8b0e9e19de999 100644
--- a/examples/placeholder/linux/apps/app2/config.matter
+++ b/examples/placeholder/linux/apps/app2/config.matter
@@ -4912,7 +4912,7 @@ server cluster ColorControl = 768 {
/** Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. */
server cluster IlluminanceMeasurement = 1024 {
- enum LightSensorType : ENUM8 {
+ enum LightSensorTypeEnum : ENUM8 {
kPhotodiode = 0;
kCmos = 1;
}
@@ -4921,7 +4921,7 @@ server cluster IlluminanceMeasurement = 1024 {
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
readonly attribute int16u tolerance = 3;
- readonly attribute nullable enum8 lightSensorType = 4;
+ readonly attribute nullable LightSensorTypeEnum lightSensorType = 4;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
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
index ff0a51361f114c..30070f05493480 100644
--- 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
@@ -30,10 +30,10 @@ limitations under the License.
MinMeasuredValue
MaxMeasuredValue
Tolerance
- LightSensorType
+ LightSensorType
-
+
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index f8bf49523fb259..91a84e3ebdd29c 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -4959,7 +4959,7 @@ client cluster BallastConfiguration = 769 {
/** Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. */
client cluster IlluminanceMeasurement = 1024 {
- enum LightSensorType : ENUM8 {
+ enum LightSensorTypeEnum : ENUM8 {
kPhotodiode = 0;
kCmos = 1;
}
@@ -4968,7 +4968,7 @@ client cluster IlluminanceMeasurement = 1024 {
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
readonly attribute optional int16u tolerance = 3;
- readonly attribute optional nullable enum8 lightSensorType = 4;
+ readonly attribute optional nullable LightSensorTypeEnum lightSensorType = 4;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
index bed47f67c2004a..20146f9072973c 100644
--- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
+++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
@@ -20851,7 +20851,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
std::string valueClassName = "java/lang/Integer";
std::string valueCtorSignature = "(I)V";
chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
- cppValue.Value(), value);
+ static_cast(cppValue.Value()), value);
}
return value;
}
diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp
index 4eab5f596c9677..21aec3904f968c 100644
--- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp
+++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp
@@ -32075,8 +32075,8 @@ CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback::~CHIPIlluminanceMeas
env->DeleteGlobalRef(javaCallbackRef);
}
-void CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback::CallbackFn(void * context,
- const chip::app::DataModel::Nullable & value)
+void CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback::CallbackFn(
+ void * context, const chip::app::DataModel::Nullable & value)
{
chip::DeviceLayer::StackUnlock unlock;
CHIP_ERROR err = CHIP_NO_ERROR;
@@ -32106,7 +32106,7 @@ void CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback::CallbackFn(void
std::string javaValueClassName = "java/lang/Integer";
std::string javaValueCtorSignature = "(I)V";
chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(),
- value.Value(), javaValue);
+ static_cast(value.Value()), javaValue);
}
env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue);
diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py
index ae4d95e1d774ed..48717a8f1b5516 100644
--- a/src/controller/python/chip/clusters/Objects.py
+++ b/src/controller/python/chip/clusters/Objects.py
@@ -27112,7 +27112,7 @@ def descriptor(cls) -> ClusterObjectDescriptor:
ClusterObjectFieldDescriptor(Label="minMeasuredValue", Tag=0x00000001, Type=typing.Union[Nullable, uint]),
ClusterObjectFieldDescriptor(Label="maxMeasuredValue", Tag=0x00000002, Type=typing.Union[Nullable, uint]),
ClusterObjectFieldDescriptor(Label="tolerance", Tag=0x00000003, Type=typing.Optional[uint]),
- ClusterObjectFieldDescriptor(Label="lightSensorType", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]),
+ ClusterObjectFieldDescriptor(Label="lightSensorType", Tag=0x00000004, Type=typing.Union[None, Nullable, IlluminanceMeasurement.Enums.LightSensorTypeEnum]),
ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]),
ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]),
ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]),
@@ -27125,7 +27125,7 @@ def descriptor(cls) -> ClusterObjectDescriptor:
minMeasuredValue: 'typing.Union[Nullable, uint]' = None
maxMeasuredValue: 'typing.Union[Nullable, uint]' = None
tolerance: 'typing.Optional[uint]' = None
- lightSensorType: 'typing.Union[None, Nullable, uint]' = None
+ lightSensorType: 'typing.Union[None, Nullable, IlluminanceMeasurement.Enums.LightSensorTypeEnum]' = None
generatedCommandList: 'typing.List[uint]' = None
acceptedCommandList: 'typing.List[uint]' = None
eventList: 'typing.List[uint]' = None
@@ -27134,7 +27134,7 @@ def descriptor(cls) -> ClusterObjectDescriptor:
clusterRevision: 'uint' = None
class Enums:
- class LightSensorType(MatterIntEnum):
+ class LightSensorTypeEnum(MatterIntEnum):
kPhotodiode = 0x00
kCmos = 0x01
# All received enum values that are not listed above will be mapped
@@ -27220,9 +27220,9 @@ def attribute_id(cls) -> int:
@ChipUtility.classproperty
def attribute_type(cls) -> ClusterObjectFieldDescriptor:
- return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint])
+ return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, IlluminanceMeasurement.Enums.LightSensorTypeEnum])
- value: 'typing.Union[None, Nullable, uint]' = None
+ value: 'typing.Union[None, Nullable, IlluminanceMeasurement.Enums.LightSensorTypeEnum]' = None
@dataclass
class GeneratedCommandList(ClusterAttributeDescriptor):
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm
index 9d6b6601ca3a38..729103e3900968 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm
@@ -16554,7 +16554,7 @@ static id _Nullable DecodeAttributeValueForIlluminanceMeasurementCluster(
if (cppValue.IsNull()) {
value = nil;
} else {
- value = [NSNumber numberWithUnsignedChar:cppValue.Value()];
+ value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())];
}
return value;
}
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
index a215e2e4eddee0..c9e63c2a757c4a 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
@@ -32999,9 +32999,9 @@ typedef NS_OPTIONS(uint32_t, MTRColorControlFeature) {
} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1));
typedef NS_ENUM(uint8_t, MTRIlluminanceMeasurementLightSensorType) {
- MTRIlluminanceMeasurementLightSensorTypePhotodiode API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00,
- MTRIlluminanceMeasurementLightSensorTypeCMOS API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01,
-} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1));
+ MTRIlluminanceMeasurementLightSensorTypePhotodiode MTR_NEWLY_AVAILABLE = 0x00,
+ MTRIlluminanceMeasurementLightSensorTypeCMOS MTR_NEWLY_AVAILABLE = 0x01,
+} MTR_NEWLY_AVAILABLE;
typedef NS_OPTIONS(uint32_t, MTRPressureMeasurementFeature) {
MTRPressureMeasurementFeatureExtended MTR_NEWLY_AVAILABLE = 0x1,
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
index 62d11498b1d53f..60a358fc650369 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
@@ -87913,7 +87913,8 @@ - (void)readAttributeLightSensorTypeWithCompletion:(void (^)(NSNumber * _Nullabl
{
MTRReadParams * params = [[MTRReadParams alloc] init];
using TypeInfo = IlluminanceMeasurement::Attributes::LightSensorType::TypeInfo;
- return MTRReadAttribute(
+ return MTRReadAttribute(
params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId());
}
@@ -87922,9 +87923,9 @@ - (void)subscribeAttributeLightSensorTypeWithParams:(MTRSubscribeParams * _Nonnu
reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler
{
using TypeInfo = IlluminanceMeasurement::Attributes::LightSensorType::TypeInfo;
- MTRSubscribeAttribute(params,
- subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(),
- TypeInfo::GetAttributeId());
+ MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint,
+ TypeInfo::GetClusterId(), TypeInfo::GetAttributeId());
}
+ (void)readAttributeLightSensorTypeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer
@@ -87933,9 +87934,9 @@ + (void)readAttributeLightSensorTypeWithClusterStateCache:(MTRClusterStateCacheC
completion:
(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
{
- auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion);
- std::move(*bridge).DispatchLocalAction(
- clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) {
+ auto * bridge = new MTRNullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge(queue, completion);
+ std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice,
+ ^(NullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallback successCb, MTRErrorCallback failureCb) {
if (clusterStateCacheContainer.cppClusterStateCache) {
chip::app::ConcreteAttributePath path;
using TypeInfo = IlluminanceMeasurement::Attributes::LightSensorType::TypeInfo;
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h
index b2949985c6f876..fdd8abdd589752 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h
@@ -635,10 +635,10 @@ typedef void (*ColorControlClusterSaturationStepModeAttributeCallback)(void *,
chip::app::Clusters::ColorControl::SaturationStepMode);
typedef void (*NullableColorControlClusterSaturationStepModeAttributeCallback)(
void *, const chip::app::DataModel::Nullable &);
-typedef void (*IlluminanceMeasurementClusterLightSensorTypeAttributeCallback)(
- void *, chip::app::Clusters::IlluminanceMeasurement::LightSensorType);
-typedef void (*NullableIlluminanceMeasurementClusterLightSensorTypeAttributeCallback)(
- void *, const chip::app::DataModel::Nullable &);
+typedef void (*IlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallback)(
+ void *, chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum);
+typedef void (*NullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallback)(
+ void *, const chip::app::DataModel::Nullable &);
typedef void (*OccupancySensingClusterOccupancySensorTypeEnumAttributeCallback)(
void *, chip::app::Clusters::OccupancySensing::OccupancySensorTypeEnum);
typedef void (*NullableOccupancySensingClusterOccupancySensorTypeEnumAttributeCallback)(
@@ -32406,71 +32406,72 @@ class MTRNullableColorControlClusterSaturationStepModeAttributeCallbackSubscript
MTRSubscriptionEstablishedHandler mEstablishedHandler;
};
-class MTRIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge
- : public MTRCallbackBridge
+class MTRIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge
+ : public MTRCallbackBridge
{
public:
- MTRIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) :
- MTRCallbackBridge(queue, handler, OnSuccessFn){};
+ MTRIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) :
+ MTRCallbackBridge(queue, handler, OnSuccessFn){};
- MTRIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler,
- MTRActionBlock action) :
- MTRCallbackBridge(queue, handler, action, OnSuccessFn){};
+ MTRIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler,
+ MTRActionBlock action) :
+ MTRCallbackBridge(queue, handler, action, OnSuccessFn){};
- static void OnSuccessFn(void * context, chip::app::Clusters::IlluminanceMeasurement::LightSensorType value);
+ static void OnSuccessFn(void * context, chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum value);
};
-class MTRIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackSubscriptionBridge
- : public MTRIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge
+class MTRIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackSubscriptionBridge
+ : public MTRIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge
{
public:
- MTRIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackSubscriptionBridge(
+ MTRIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackSubscriptionBridge(
dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action,
MTRSubscriptionEstablishedHandler establishedHandler) :
- MTRIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge(queue, handler, action),
+ MTRIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge(queue, handler, action),
mEstablishedHandler(establishedHandler)
{}
void OnSubscriptionEstablished();
- using MTRIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge::KeepAliveOnCallback;
- using MTRIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge::OnDone;
+ using MTRIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge::KeepAliveOnCallback;
+ using MTRIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge::OnDone;
private:
MTRSubscriptionEstablishedHandler mEstablishedHandler;
};
-class MTRNullableIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge
- : public MTRCallbackBridge
+class MTRNullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge
+ : public MTRCallbackBridge
{
public:
- MTRNullableIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge(dispatch_queue_t queue,
- ResponseHandler handler) :
- MTRCallbackBridge(queue, handler, OnSuccessFn){};
+ MTRNullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge(dispatch_queue_t queue,
+ ResponseHandler handler) :
+ MTRCallbackBridge(queue, handler, OnSuccessFn){};
- MTRNullableIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler,
- MTRActionBlock action) :
- MTRCallbackBridge(queue, handler, action,
- OnSuccessFn){};
+ MTRNullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge(dispatch_queue_t queue,
+ ResponseHandler handler,
+ MTRActionBlock action) :
+ MTRCallbackBridge(queue, handler, action,
+ OnSuccessFn){};
static void
OnSuccessFn(void * context,
- const chip::app::DataModel::Nullable & value);
+ const chip::app::DataModel::Nullable & value);
};
-class MTRNullableIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackSubscriptionBridge
- : public MTRNullableIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge
+class MTRNullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackSubscriptionBridge
+ : public MTRNullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge
{
public:
- MTRNullableIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackSubscriptionBridge(
+ MTRNullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackSubscriptionBridge(
dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action,
MTRSubscriptionEstablishedHandler establishedHandler) :
- MTRNullableIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge(queue, handler, action),
+ MTRNullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge(queue, handler, action),
mEstablishedHandler(establishedHandler)
{}
void OnSubscriptionEstablished();
- using MTRNullableIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge::KeepAliveOnCallback;
- using MTRNullableIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge::OnDone;
+ using MTRNullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge::KeepAliveOnCallback;
+ using MTRNullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge::OnDone;
private:
MTRSubscriptionEstablishedHandler mEstablishedHandler;
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm
index fa6adc0121a03b..f490db43d38b49 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm
@@ -30105,15 +30105,15 @@
}
}
-void MTRIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge::OnSuccessFn(
- void * context, chip::app::Clusters::IlluminanceMeasurement::LightSensorType value)
+void MTRIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge::OnSuccessFn(
+ void * context, chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum value)
{
NSNumber * _Nonnull objCValue;
objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)];
DispatchSuccess(context, objCValue);
};
-void MTRIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished()
+void MTRIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished()
{
if (!mQueue) {
return;
@@ -30128,8 +30128,8 @@
}
}
-void MTRNullableIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackBridge::OnSuccessFn(
- void * context, const chip::app::DataModel::Nullable & value)
+void MTRNullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackBridge::OnSuccessFn(
+ void * context, const chip::app::DataModel::Nullable & value)
{
NSNumber * _Nullable objCValue;
if (value.IsNull()) {
@@ -30140,7 +30140,7 @@
DispatchSuccess(context, objCValue);
};
-void MTRNullableIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished()
+void MTRNullableIlluminanceMeasurementClusterLightSensorTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished()
{
if (!mQueue) {
return;
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 e2707246b3e620..4093109d9c4b87 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
@@ -19540,9 +19540,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value)
namespace LightSensorType {
-EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value)
+EmberAfStatus Get(chip::EndpointId endpoint,
+ DataModel::Nullable & value)
{
- using Traits = NumericAttributeTraits;
+ using Traits = NumericAttributeTraits;
Traits::StorageType temp;
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp));
@@ -19557,9 +19558,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu
}
return status;
}
-EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value)
+EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum value)
{
- using Traits = NumericAttributeTraits;
+ using Traits = NumericAttributeTraits;
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
{
return EMBER_ZCL_STATUS_CONSTRAINT_ERROR;
@@ -19572,14 +19573,15 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value)
EmberAfStatus SetNull(chip::EndpointId endpoint)
{
- using Traits = NumericAttributeTraits;
+ using Traits = NumericAttributeTraits;
Traits::StorageType value;
Traits::SetNull(value);
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
return emberAfWriteAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
}
-EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value)
+EmberAfStatus Set(chip::EndpointId endpoint,
+ const chip::app::DataModel::Nullable & value)
{
if (value.IsNull())
{
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 730932955f6d19..8df76d7b406bc8 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
@@ -3451,10 +3451,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value);
} // namespace Tolerance
namespace LightSensorType {
-EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // enum8
-EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value);
+EmberAfStatus
+Get(chip::EndpointId endpoint,
+ DataModel::Nullable & value); // LightSensorTypeEnum
+EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum value);
EmberAfStatus SetNull(chip::EndpointId endpoint);
-EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value);
+EmberAfStatus Set(chip::EndpointId endpoint,
+ const chip::app::DataModel::Nullable & value);
} // namespace LightSensorType
namespace FeatureMap {
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h
index 552065201c028a..500281c430ee03 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h
@@ -2334,9 +2334,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::Saturatio
}
}
-static auto __attribute__((unused)) EnsureKnownEnumValue(IlluminanceMeasurement::LightSensorType val)
+static auto __attribute__((unused)) EnsureKnownEnumValue(IlluminanceMeasurement::LightSensorTypeEnum val)
{
- using EnumType = IlluminanceMeasurement::LightSensorType;
+ using EnumType = IlluminanceMeasurement::LightSensorTypeEnum;
switch (val)
{
case EnumType::kPhotodiode:
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h
index 47bec8ad525f4d..81be49547595aa 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h
@@ -3087,8 +3087,8 @@ namespace BallastConfiguration {} // namespace BallastConfiguration
namespace IlluminanceMeasurement {
-// Enum for LightSensorType
-enum class LightSensorType : uint8_t
+// Enum for LightSensorTypeEnum
+enum class LightSensorTypeEnum : uint8_t
{
kPhotodiode = 0x00,
kCmos = 0x01,
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 8b8c7fb08a173c..aba1eeef7cdc8d 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
@@ -24464,9 +24464,10 @@ struct TypeInfo
namespace LightSensorType {
struct TypeInfo
{
- using Type = chip::app::DataModel::Nullable;
- using DecodableType = chip::app::DataModel::Nullable;
- using DecodableArgType = const chip::app::DataModel::Nullable &;
+ using Type = chip::app::DataModel::Nullable;
+ using DecodableType = chip::app::DataModel::Nullable;
+ using DecodableArgType =
+ const chip::app::DataModel::Nullable &;
static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceMeasurement::Id; }
static constexpr AttributeId GetAttributeId() { return Attributes::LightSensorType::Id; }
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
index 01b4df44e383df..eaf746fd85c26d 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
@@ -17163,9 +17163,10 @@ void registerClusterIlluminanceMeasurement(Commands & commands, CredentialIssuer
WriteCommandType::kForceWrite, credsIssuerConfig), //
make_unique>(Id, "tolerance", 0, UINT16_MAX, Attributes::Tolerance::Id,
WriteCommandType::kForceWrite, credsIssuerConfig), //
- make_unique>>(Id, "light-sensor-type", 0, UINT8_MAX,
- Attributes::LightSensorType::Id,
- WriteCommandType::kForceWrite, credsIssuerConfig), //
+ make_unique<
+ WriteAttribute>>(
+ Id, "light-sensor-type", 0, UINT8_MAX, Attributes::LightSensorType::Id, WriteCommandType::kForceWrite,
+ credsIssuerConfig), //
make_unique>>(
Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite,
credsIssuerConfig), //
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
index dcb545deebe5a8..4336af498a6948 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
@@ -10259,7 +10259,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP
return DataModelLogger::LogValue("Tolerance", 1, value);
}
case IlluminanceMeasurement::Attributes::LightSensorType::Id: {
- chip::app::DataModel::Nullable value;
+ chip::app::DataModel::Nullable value;
ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
return DataModelLogger::LogValue("LightSensorType", 1, value);
}
diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h
index 99657f82346338..6c9a5279270654 100644
--- a/zzz_generated/chip-tool/zap-generated/test/Commands.h
+++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h
@@ -29187,7 +29187,7 @@ class Test_TC_ILL_2_1Suite : public TestCommand
case 5:
VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
{
- chip::app::DataModel::Nullable value;
+ chip::app::DataModel::Nullable value;
VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8"));
VerifyOrReturn(CheckConstraintMinValue("value", value, 0U));