diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index c827aaefaa1c90..1928718682d743 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -1491,8 +1491,8 @@ cluster FixedLabel = 64 { cluster SampleMei = 4294048800 { revision 1; // NOTE: Default/not specifically set - fabric_sensitive info event Pinged = 0 { - int8u arg1 = 1; + fabric_sensitive info event PingCountEvent = 0 { + int32u count = 1; fabric_idx fabricIndex = 254; } @@ -1830,7 +1830,7 @@ endpoint 1 { } server cluster SampleMei { - emits event Pinged; + emits event PingCountEvent; ram attribute flipFlop default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; diff --git a/src/app/clusters/sample-mei-server/sample-mei-server.cpp b/src/app/clusters/sample-mei-server/sample-mei-server.cpp index fcdbb5efdd81bd..749dfbc1e05355 100644 --- a/src/app/clusters/sample-mei-server/sample-mei-server.cpp +++ b/src/app/clusters/sample-mei-server/sample-mei-server.cpp @@ -60,6 +60,7 @@ SampleMeiContent::SampleMeiContent() : SampleMeiContent(kInvalidEndpointId) {} SampleMeiContent::SampleMeiContent(EndpointId aEndpoint) { endpoint = aEndpoint; + pingCount = 10000; // Attribute default values flipflop = false; @@ -68,10 +69,10 @@ SampleMeiContent::SampleMeiContent(EndpointId aEndpoint) // ***************************************************************************** // SampleMeiServer -static uint8_t gPinged = 0; void SampleMeiServer::InvokeCommand(HandlerContext & ctxt) { auto endpoint = ctxt.mRequestPath.mEndpointId; + auto fabricIndex = ctxt.mCommandHandler.GetAccessingFabricIndex(); auto endpointIndex = EndpointIndex(endpoint); if (endpointIndex == std::numeric_limits::max()) { @@ -82,19 +83,16 @@ void SampleMeiServer::InvokeCommand(HandlerContext & ctxt) switch (ctxt.mRequestPath.mCommandId) { case Commands::Ping::Id: - HandleCommand(ctxt, [endpoint](HandlerContext & ctx, const auto & req) { + HandleCommand(ctxt, [this, endpoint, fabricIndex, endpointIndex, ctxt](HandlerContext & ctx, const auto & req) { ChipLogProgress(Zcl, "Ping Command on Ep %d", endpoint); - Events::Pinged::Type event{ .arg1 = ++gPinged, .fabricIndex = 1 }; - chip::EventNumber n = gPinged; - if (CHIP_NO_ERROR != LogEvent(event, 1 /*endpoint*/, n)) + Events::PingCountEvent::Type event{ .count = content[endpointIndex].pingCount++, .fabricIndex = fabricIndex }; + chip::EventNumber placeholderEventNumber; + CHIP_ERROR err = LogEvent(event, endpoint, placeholderEventNumber); + if (CHIP_NO_ERROR != err) { - // TBD - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success); - } - else - { - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success); + ChipLogError(Zcl, "Failed to record event on endpoint %d: %" CHIP_ERROR_FORMAT, static_cast(endpoint), err.Format()); } + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success); }); return; case Commands::AddArguments::Id: diff --git a/src/app/clusters/sample-mei-server/sample-mei-server.h b/src/app/clusters/sample-mei-server/sample-mei-server.h index 3f4463215e4acc..c7a11fb6aaf480 100644 --- a/src/app/clusters/sample-mei-server/sample-mei-server.h +++ b/src/app/clusters/sample-mei-server/sample-mei-server.h @@ -32,10 +32,12 @@ class SampleMeiContent { public: EndpointId endpoint; + uint32_t pingCount; // Attribute List bool flipflop; /* Attributes::FlipFlop::Id */ + SampleMeiContent(EndpointId endpoint); SampleMeiContent(); }; diff --git a/src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml index 1dadc1cae411a2..9b812b85c535d3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml @@ -56,9 +56,9 @@ limitations under the License. - + Example events generated by Ping command - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 993a3e2a0494b7..050d626a8ad1af 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -8632,8 +8632,8 @@ internal cluster FaultInjection = 4294048774 { cluster SampleMei = 4294048800 { revision 1; // NOTE: Default/not specifically set - fabric_sensitive info event Pinged = 0 { - int8u arg1 = 1; + fabric_sensitive info event PingCountEvent = 0 { + int32u count = 1; fabric_idx fabricIndex = 254; } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index fc404945541f14..fed5d098563f46 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -4713,39 +4713,39 @@ public String toString() { return output.toString(); } } -public static class SampleMeiClusterPingedEvent { - public Integer arg1; +public static class SampleMeiClusterPingCountEventEvent { + public Long count; public Integer fabricIndex; - private static final long ARG1_ID = 1L; + private static final long COUNT_ID = 1L; private static final long FABRIC_INDEX_ID = 254L; - public SampleMeiClusterPingedEvent( - Integer arg1, + public SampleMeiClusterPingCountEventEvent( + Long count, Integer fabricIndex ) { - this.arg1 = arg1; + this.count = count; this.fabricIndex = fabricIndex; } public StructType encodeTlv() { ArrayList values = new ArrayList<>(); - values.add(new StructElement(ARG1_ID, new UIntType(arg1))); + values.add(new StructElement(COUNT_ID, new UIntType(count))); values.add(new StructElement(FABRIC_INDEX_ID, new UIntType(fabricIndex))); return new StructType(values); } - public static SampleMeiClusterPingedEvent decodeTlv(BaseTLVType tlvValue) { + public static SampleMeiClusterPingCountEventEvent decodeTlv(BaseTLVType tlvValue) { if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } - Integer arg1 = null; + Long count = null; Integer fabricIndex = null; for (StructElement element: ((StructType)tlvValue).value()) { - if (element.contextTagNum() == ARG1_ID) { + if (element.contextTagNum() == COUNT_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - arg1 = castingValue.value(Integer.class); + count = castingValue.value(Long.class); } } else if (element.contextTagNum() == FABRIC_INDEX_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -4754,8 +4754,8 @@ public static SampleMeiClusterPingedEvent decodeTlv(BaseTLVType tlvValue) { } } } - return new SampleMeiClusterPingedEvent( - arg1, + return new SampleMeiClusterPingCountEventEvent( + count, fabricIndex ); } @@ -4763,9 +4763,9 @@ public static SampleMeiClusterPingedEvent decodeTlv(BaseTLVType tlvValue) { @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("SampleMeiClusterPingedEvent {\n"); - output.append("\targ1: "); - output.append(arg1); + output.append("SampleMeiClusterPingCountEventEvent {\n"); + output.append("\tcount: "); + output.append(count); output.append("\n"); output.append("\tfabricIndex: "); output.append(fabricIndex); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index cf6783b13cd7b6..b85392a134dbf7 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -16338,7 +16338,7 @@ public static Attribute value(long id) throws NoSuchFieldError { } public enum Event { - Pinged(0L),; + PingCountEvent(0L),; private final long id; Event(long id) { this.id = id; diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SampleMeiClusterPingCountEventEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SampleMeiClusterPingCountEventEvent.kt new file mode 100644 index 00000000000000..a0588f4ad66d56 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SampleMeiClusterPingCountEventEvent.kt @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class SampleMeiClusterPingCountEventEvent(val count: ULong, val fabricIndex: UInt) { + override fun toString(): String = buildString { + append("SampleMeiClusterPingCountEventEvent {\n") + append("\tcount : $count\n") + append("\tfabricIndex : $fabricIndex\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_COUNT), count) + put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) + endStructure() + } + } + + companion object { + private const val TAG_COUNT = 1 + private const val TAG_FABRIC_INDEX = 254 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): SampleMeiClusterPingCountEventEvent { + tlvReader.enterStructure(tlvTag) + val count = tlvReader.getULong(ContextSpecificTag(TAG_COUNT)) + val fabricIndex = tlvReader.getUInt(ContextSpecificTag(TAG_FABRIC_INDEX)) + + tlvReader.exitContainer() + + return SampleMeiClusterPingCountEventEvent(count, fabricIndex) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index 016f49ac8a44be..0f77afec3d37a8 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -164,7 +164,7 @@ eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RefrigeratorAlarmClusterNotifyEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationalErrorEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationCompletionEvent.kt", - "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SampleMeiClusterPingedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SampleMeiClusterPingCountEventEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterCOAlarmEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectCOAlarmEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectSmokeAlarmEvent.kt", diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/SampleMeiClusterPingCountEventEvent.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/SampleMeiClusterPingCountEventEvent.kt new file mode 100644 index 00000000000000..946a5949dae51e --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/SampleMeiClusterPingCountEventEvent.kt @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.eventstructs + +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class SampleMeiClusterPingCountEventEvent(val count: UInt, val fabricIndex: UByte) { + override fun toString(): String = buildString { + append("SampleMeiClusterPingCountEventEvent {\n") + append("\tcount : $count\n") + append("\tfabricIndex : $fabricIndex\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_COUNT), count) + put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) + endStructure() + } + } + + companion object { + private const val TAG_COUNT = 1 + private const val TAG_FABRIC_INDEX = 254 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): SampleMeiClusterPingCountEventEvent { + tlvReader.enterStructure(tlvTag) + val count = tlvReader.getUInt(ContextSpecificTag(TAG_COUNT)) + val fabricIndex = tlvReader.getUByte(ContextSpecificTag(TAG_FABRIC_INDEX)) + + tlvReader.exitContainer() + + return SampleMeiClusterPingCountEventEvent(count, fabricIndex) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni index 4ee2cb5552b59e..b12d23f039fa29 100644 --- a/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni @@ -164,7 +164,7 @@ matter_eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/RefrigeratorAlarmClusterNotifyEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationalErrorEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationCompletionEvent.kt", - "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/SampleMeiClusterPingedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/SampleMeiClusterPingCountEventEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterCOAlarmEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectCOAlarmEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectSmokeAlarmEvent.kt", diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 5566638dffdee0..0ff5d7e683c313 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -6701,19 +6701,19 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & using namespace app::Clusters::SampleMei; switch (aPath.mEventId) { - case Events::Pinged::Id: { - Events::Pinged::DecodableType cppValue; + case Events::PingCountEvent::Id: { + Events::PingCountEvent::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nullptr; } - jobject value_arg1; - std::string value_arg1ClassName = "java/lang/Integer"; - std::string value_arg1CtorSignature = "(I)V"; - jint jnivalue_arg1 = static_cast(cppValue.arg1); - chip::JniReferences::GetInstance().CreateBoxedObject(value_arg1ClassName.c_str(), value_arg1CtorSignature.c_str(), - jnivalue_arg1, value_arg1); + jobject value_count; + std::string value_countClassName = "java/lang/Long"; + std::string value_countCtorSignature = "(J)V"; + jlong jnivalue_count = static_cast(cppValue.count); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_countClassName.c_str(), value_countCtorSignature.c_str(), jnivalue_count, value_count); jobject value_fabricIndex; std::string value_fabricIndexClassName = "java/lang/Integer"; @@ -6723,22 +6723,23 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_fabricIndexCtorSignature.c_str(), jnivalue_fabricIndex, value_fabricIndex); - jclass pingedStructClass; + jclass pingCountEventStructClass; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipEventStructs$SampleMeiClusterPingedEvent", pingedStructClass); + env, "chip/devicecontroller/ChipEventStructs$SampleMeiClusterPingCountEventEvent", pingCountEventStructClass); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipEventStructs$SampleMeiClusterPingedEvent"); + ChipLogError(Zcl, "Could not find class ChipEventStructs$SampleMeiClusterPingCountEventEvent"); return nullptr; } - jmethodID pingedStructCtor = env->GetMethodID(pingedStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); - if (pingedStructCtor == nullptr) + jmethodID pingCountEventStructCtor = + env->GetMethodID(pingCountEventStructClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;)V"); + if (pingCountEventStructCtor == nullptr) { - ChipLogError(Zcl, "Could not find ChipEventStructs$SampleMeiClusterPingedEvent constructor"); + ChipLogError(Zcl, "Could not find ChipEventStructs$SampleMeiClusterPingCountEventEvent constructor"); return nullptr; } - jobject value = env->NewObject(pingedStructClass, pingedStructCtor, value_arg1, value_fabricIndex); + jobject value = env->NewObject(pingCountEventStructClass, pingCountEventStructCtor, value_count, value_fabricIndex); return value; } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index be5d0ad54dafc3..59915a932abb75 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -46754,7 +46754,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Events: @dataclass - class Pinged(ClusterEvent): + class PingCountEvent(ClusterEvent): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0xFFF1FC20 @@ -46767,10 +46767,10 @@ def event_id(cls) -> int: def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="arg1", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="count", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=254, Type=uint), ]) - arg1: 'uint' = 0 + count: 'uint' = 0 fabricIndex: 'uint' = 0 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 56155c0e8c58e2..5587bb989e376a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -7282,6 +7282,6 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterUnitTestingEventTestFabricScopedEventID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000002, // Cluster SampleMEI events - MTREventIDTypeClusterSampleMEIEventPingedID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterSampleMEIEventPingCountEventID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, }; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 659b9ec8de033a..4f14340ed8ac46 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4075,19 +4075,19 @@ static id _Nullable DecodeEventPayloadForSampleMEICluster(EventId aEventId, TLV: { using namespace Clusters::SampleMei; switch (aEventId) { - case Events::Pinged::Id: { - Events::Pinged::DecodableType cppValue; + case Events::PingCountEvent::Id: { + Events::PingCountEvent::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - __auto_type * value = [MTRSampleMEIClusterPingedEvent new]; + __auto_type * value = [MTRSampleMEIClusterPingCountEventEvent new]; do { NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedChar:cppValue.arg1]; - value.arg1 = memberValue; + memberValue = [NSNumber numberWithUnsignedInt:cppValue.count]; + value.count = memberValue; } while (0); do { NSNumber * _Nonnull memberValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index da839cc6ca736b..f66c4b1c35f391 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1909,8 +1909,8 @@ MTR_DEPRECATED("Please use MTRUnitTestingClusterTestFabricScopedEventEvent", ios @end MTR_PROVISIONALLY_AVAILABLE -@interface MTRSampleMEIClusterPingedEvent : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull arg1 MTR_PROVISIONALLY_AVAILABLE; +@interface MTRSampleMEIClusterPingCountEventEvent : NSObject +@property (nonatomic, copy, getter=getCount) NSNumber * _Nonnull count MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex MTR_PROVISIONALLY_AVAILABLE; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 28c400f7b0040b..1abf92201f66ab 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -7509,12 +7509,12 @@ @implementation MTRTestClusterClusterTestFabricScopedEventEvent : MTRUnitTesting @dynamic fabricIndex; @end -@implementation MTRSampleMEIClusterPingedEvent +@implementation MTRSampleMEIClusterPingCountEventEvent - (instancetype)init { if (self = [super init]) { - _arg1 = @(0); + _count = @(0); _fabricIndex = @(0); } @@ -7523,9 +7523,9 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRSampleMEIClusterPingedEvent alloc] init]; + auto other = [[MTRSampleMEIClusterPingCountEventEvent alloc] init]; - other.arg1 = self.arg1; + other.count = self.count; other.fabricIndex = self.fabricIndex; return other; @@ -7533,7 +7533,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: arg1:%@; fabricIndex:%@; >", NSStringFromClass([self class]), _arg1, _fabricIndex]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: count:%@; fabricIndex:%@; >", NSStringFromClass([self class]), _count, _fabricIndex]; return descriptionString; } 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 2a4a5b573f2ae3..8bee9da375dcc3 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 @@ -27641,12 +27641,12 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre } // namespace Attributes namespace Events { -namespace Pinged { +namespace PingCountEvent { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { TLV::TLVType outer; ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kArg1), arg1)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCount), count)); ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kFabricIndex), fabricIndex)); return aWriter.EndContainer(outer); } @@ -27665,9 +27665,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kArg1)) + if (__context_tag == to_underlying(Fields::kCount)) { - err = DataModel::Decode(reader, arg1); + err = DataModel::Decode(reader, count); } else if (__context_tag == to_underlying(Fields::kFabricIndex)) { @@ -27680,7 +27680,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace Pinged. +} // namespace PingCountEvent. } // namespace Events } // namespace SampleMei 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 2d4855b8b86a43..4432f901d12b1b 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 @@ -42009,12 +42009,12 @@ struct TypeInfo }; } // namespace Attributes namespace Events { -namespace Pinged { +namespace PingCountEvent { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; enum class Fields : uint8_t { - kArg1 = 1, + kCount = 1, kFabricIndex = 254, }; @@ -42022,11 +42022,11 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return Events::Pinged::Id; } + static constexpr EventId GetEventId() { return Events::PingCountEvent::Id; } static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } static constexpr bool kIsFabricScoped = true; - uint8_t arg1 = static_cast(0); + uint32_t count = static_cast(0); chip::FabricIndex fabricIndex = static_cast(0); auto GetFabricIndex() const { return fabricIndex; } @@ -42038,15 +42038,15 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return Events::Pinged::Id; } + static constexpr EventId GetEventId() { return Events::PingCountEvent::Id; } static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } - uint8_t arg1 = static_cast(0); + uint32_t count = static_cast(0); chip::FabricIndex fabricIndex = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace Pinged +} // namespace PingCountEvent } // namespace Events } // namespace SampleMei diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index 51f5afcbfe10b0..807f2f077d8095 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -626,9 +626,9 @@ static constexpr EventId Id = 0x00000002; namespace SampleMei { namespace Events { -namespace Pinged { +namespace PingCountEvent { static constexpr EventId Id = 0x00000000; -} // namespace Pinged +} // namespace PingCountEvent } // namespace Events } // namespace SampleMei diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 433221b33315e8..0795307c52b200 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -13840,7 +13840,7 @@ class FaultInjectionFailRandomlyAtFault : public ClusterCommand | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | -| * Pinged | 0x0000 | +| * PingCountEvent | 0x0000 | \*----------------------------------------------------------------------------*/ /* @@ -25164,10 +25164,10 @@ void registerClusterSampleMei(Commands & commands, CredentialIssuerCommands * cr // // Events // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "pinged", Events::Pinged::Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "pinged", Events::Pinged::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "ping-count-event", Events::PingCountEvent::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "ping-count-event", Events::PingCountEvent::Id, credsIssuerConfig), // }; commands.RegisterCluster(clusterName, clusterCommands); 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 8d7cc7f2bea928..a33e413d1fb045 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -6263,14 +6263,15 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const SampleMei::Events::Pinged::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SampleMei::Events::PingCountEvent::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Arg1", indent + 1, value.arg1); + CHIP_ERROR err = DataModelLogger::LogValue("Count", indent + 1, value.count); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg1'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Count'"); return err; } } @@ -17794,10 +17795,10 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip case SampleMei::Id: { switch (header.mPath.mEventId) { - case SampleMei::Events::Pinged::Id: { - chip::app::Clusters::SampleMei::Events::Pinged::DecodableType value; + case SampleMei::Events::PingCountEvent::Id: { + chip::app::Clusters::SampleMei::Events::PingCountEvent::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Pinged", 1, value); + return DataModelLogger::LogValue("PingCountEvent", 1, value); } } break; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 75c6066966a98b..506e26f03dc1eb 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -549,7 +549,7 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Events::TestFabricScopedEvent::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::SampleMei::Events::Pinged::DecodableType & value); + const chip::app::Clusters::SampleMei::Events::PingCountEvent::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & value); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 73d2dfe0edd6f5..816f1b656a11a4 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -171277,7 +171277,7 @@ class SubscribeAttributeUnitTestingClusterRevision : public SubscribeAttribute { | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | -| * Pinged | 0x0000 | +| * PingCountEvent | 0x0000 | \*----------------------------------------------------------------------------*/ #if MTR_ENABLE_PROVISIONAL