Skip to content

Commit

Permalink
Stop incorrectly flagging door lock events as fabric-scoped. (#14582)
Browse files Browse the repository at this point in the history
Fixes #14365
Fixes #14573
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jul 27, 2023
1 parent 1ef8cdf commit 5199449
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 34 deletions.
25 changes: 1 addition & 24 deletions src/app/EventLogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T,
std::enable_if_t<DataModel::IsFabricScoped<T>::value &&
std::is_same<decltype(std::declval<T>().GetFabricIndex()), FabricIndex>::value,
bool> = true>
template <typename T, std::enable_if_t<DataModel::IsFabricScoped<T>::value, bool> = true>
CHIP_ERROR LogEvent(const T & aEventData, EndpointId aEndpoint, EventNumber & aEventNumber,
EventOptions::Type aUrgent = EventOptions::Type::kNotUrgent)
{
Expand All @@ -83,24 +78,6 @@ CHIP_ERROR LogEvent(const T & aEventData, EndpointId aEndpoint, EventNumber & aE
return logMgmt.LogEvent(&eventData, eventOptions, aEventNumber);
}

template <typename T,
std::enable_if_t<DataModel::IsFabricScoped<T>::value &&
std::is_same<decltype(std::declval<T>().GetFabricIndex()), DataModel::Nullable<FabricIndex>>::value,
bool> = true>
CHIP_ERROR LogEvent(const T & aEventData, EndpointId aEndpoint, EventNumber & aEventNumber,
EventOptions::Type aUrgent = EventOptions::Type::kNotUrgent)
{
EventLogger<T> 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 <typename T, std::enable_if_t<!DataModel::IsFabricScoped<T>::value, bool> = true>
CHIP_ERROR LogEvent(const T & aEventData, EndpointId aEndpoint, EventNumber & aEventNumber,
EventOptions::Type aUrgent = EventOptions::Type::kNotUrgent)
Expand Down
2 changes: 1 addition & 1 deletion third_party/zap/repo

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5199449

Please sign in to comment.