Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop incorrectly flagging door lock events as fabric-scoped. #14582

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.