From 5dcc16aea19a83bd6501c77020e419999ce8df4d Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 29 Jan 2022 06:20:24 -0500 Subject: [PATCH] Stop incorrectly flagging door lock events as fabric-scoped. Fixes https://github.com/project-chip/connectedhomeip/issues/14365 Fixes https://github.com/project-chip/connectedhomeip/issues/14573 --- src/app/EventLogging.h | 25 +------------------ third_party/zap/repo | 2 +- .../zap-generated/cluster-objects.h | 12 +++------ 3 files changed, 5 insertions(+), 34 deletions(-) diff --git a/src/app/EventLogging.h b/src/app/EventLogging.h index c85ad77323eed1..6b9f35be83bf86 100644 --- a/src/app/EventLogging.h +++ b/src/app/EventLogging.h @@ -61,14 +61,9 @@ class EventLogger : public EventLoggingDelegate * @param[out] aEventNumber The event Number if the event was written to the * log, 0 otherwise. The Event number is expected to monotonically increase. * - * TODO: Revisit spec foc nullable fabric index in event. - * * @return CHIP_ERROR CHIP Error Code */ -template ::value && - std::is_same().GetFabricIndex()), FabricIndex>::value, - bool> = true> +template ::value, bool> = true> CHIP_ERROR LogEvent(const T & aEventData, EndpointId aEndpoint, EventNumber & aEventNumber, EventOptions::Type aUrgent = EventOptions::Type::kNotUrgent) { @@ -83,24 +78,6 @@ CHIP_ERROR LogEvent(const T & aEventData, EndpointId aEndpoint, EventNumber & aE return logMgmt.LogEvent(&eventData, eventOptions, aEventNumber); } -template ::value && - std::is_same().GetFabricIndex()), DataModel::Nullable>::value, - bool> = true> -CHIP_ERROR LogEvent(const T & aEventData, EndpointId aEndpoint, EventNumber & aEventNumber, - EventOptions::Type aUrgent = EventOptions::Type::kNotUrgent) -{ - EventLogger eventData(aEventData); - ConcreteEventPath path(aEndpoint, aEventData.GetClusterId(), aEventData.GetEventId()); - EventManagement & logMgmt = chip::app::EventManagement::GetInstance(); - EventOptions eventOptions; - eventOptions.mUrgent = aUrgent; - eventOptions.mPath = path; - eventOptions.mPriority = aEventData.GetPriorityLevel(); - eventOptions.mFabricIndex = aEventData.GetFabricIndex().IsNull() ? kUndefinedFabricIndex : aEventData.GetFabricIndex().Value(); - return logMgmt.LogEvent(&eventData, eventOptions, aEventNumber); -} - template ::value, bool> = true> CHIP_ERROR LogEvent(const T & aEventData, EndpointId aEndpoint, EventNumber & aEventNumber, EventOptions::Type aUrgent = EventOptions::Type::kNotUrgent) diff --git a/third_party/zap/repo b/third_party/zap/repo index 5ee050719bf25f..696593154ba6df 160000 --- a/third_party/zap/repo +++ b/third_party/zap/repo @@ -1 +1 @@ -Subproject commit 5ee050719bf25f7c02c63e394bb5747f845edfab +Subproject commit 696593154ba6df3d22bde2f4128c133fc31f765e 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 08fb61a7e0c409..630716796cd5dc 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 @@ -19731,7 +19731,7 @@ struct Type static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return Events::LockOperation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } - static constexpr bool kIsFabricScoped = true; + static constexpr bool kIsFabricScoped = false; DlLockOperationType lockOperationType = static_cast(0); DlOperationSource operationSource = static_cast(0); @@ -19740,8 +19740,6 @@ struct Type DataModel::Nullable sourceNode; Optional>> credentials; - auto GetFabricIndex() const { return fabricIndex; } - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -19782,7 +19780,7 @@ struct Type static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return Events::LockOperationError::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } - static constexpr bool kIsFabricScoped = true; + static constexpr bool kIsFabricScoped = false; DlLockOperationType lockOperationType = static_cast(0); DlOperationSource operationSource = static_cast(0); @@ -19792,8 +19790,6 @@ struct Type DataModel::Nullable sourceNode; Optional>> credentials; - auto GetFabricIndex() const { return fabricIndex; } - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -19835,7 +19831,7 @@ struct Type static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return Events::LockUserChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } - static constexpr bool kIsFabricScoped = true; + static constexpr bool kIsFabricScoped = false; DlLockDataType lockDataType = static_cast(0); DlDataOperationType dataOperationType = static_cast(0); @@ -19845,8 +19841,6 @@ struct Type DataModel::Nullable sourceNode; DataModel::Nullable dataIndex; - auto GetFabricIndex() const { return fabricIndex; } - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; };