From bce88406c930e8d0e112fabefff0123f5cfbad34 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 27 Oct 2023 10:46:22 -0400 Subject: [PATCH 1/2] Type of sources should be endpoint_no instead of raw int8u --- .../zcl/data-model/chip/power-source-configuration-cluster.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml index 347762b8d4cedd..994cdb78969a88 100644 --- a/src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml @@ -26,6 +26,6 @@ limitations under the License. true true - Sources + Sources From 99a7a110ce1c4aef62652079f98e48f3c3015b47 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 27 Oct 2023 10:47:12 -0400 Subject: [PATCH 2/2] Zap regen --- .../all-clusters-common/all-clusters-app.matter | 2 +- src/controller/data_model/controller-clusters.matter | 2 +- src/controller/java/zap-generated/CHIPClientCallbacks.h | 4 ++-- src/controller/java/zap-generated/CHIPReadCallbacks.cpp | 4 ++-- .../CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm | 2 +- .../app-common/app-common/zap-generated/cluster-objects.h | 6 +++--- zzz_generated/chip-tool/zap-generated/cluster/Commands.h | 2 +- .../zap-generated/cluster/logging/DataModelLogger.cpp | 2 +- 8 files changed, 12 insertions(+), 12 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 7f3601b0078991..0acd559d7f5673 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 @@ -1077,7 +1077,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to describe the configuration and capabilities of a Device's power system. */ server cluster PowerSourceConfiguration = 46 { - readonly attribute int8u sources[] = 0; + readonly attribute endpoint_no sources[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index caabe18f4fa4b4..1650e3825916e4 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1157,7 +1157,7 @@ client cluster UnitLocalization = 45 { /** This cluster is used to describe the configuration and capabilities of a Device's power system. */ client cluster PowerSourceConfiguration = 46 { - readonly attribute int8u sources[] = 0; + readonly attribute endpoint_no sources[] = 0; 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/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index 76f215309f6705..30c2b580433cd9 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -210,8 +210,8 @@ typedef void (*UnitLocalizationEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*UnitLocalizationAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*PowerSourceConfigurationSourcesListAttributeCallback)(void * context, - const chip::app::DataModel::DecodableList & data); +typedef void (*PowerSourceConfigurationSourcesListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*PowerSourceConfigurationGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*PowerSourceConfigurationAcceptedCommandListListAttributeCallback)( diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 23ceb0dfcdfa32..f71fce0e5c8de4 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -7193,8 +7193,8 @@ CHIPPowerSourceConfigurationSourcesAttributeCallback::~CHIPPowerSourceConfigurat env->DeleteGlobalRef(javaCallbackRef); } -void CHIPPowerSourceConfigurationSourcesAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPPowerSourceConfigurationSourcesAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 4fcd7e0c8bd86f..36b35218c527d9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -1830,7 +1830,7 @@ static id _Nullable DecodeAttributeValueForPowerSourceConfigurationCluster(Attri while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); 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 26ad7ac20b2b50..0fe87816d21902 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 @@ -6128,9 +6128,9 @@ namespace Attributes { namespace Sources { struct TypeInfo { - using Type = chip::app::DataModel::List; - using DecodableType = chip::app::DataModel::DecodableList; - using DecodableArgType = const chip::app::DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PowerSourceConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Sources::Id; } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index bd1852ca31af5a..436f35d66aeeec 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -12868,7 +12868,7 @@ void registerClusterPowerSourceConfiguration(Commands & commands, CredentialIssu make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>>( + make_unique>>( Id, "sources", Attributes::Sources::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, 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 ae45b6d5ef70c7..45d4364be639bf 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -6174,7 +6174,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP switch (path.mAttributeId) { case PowerSourceConfiguration::Attributes::Sources::Id: { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Sources", 1, value); }