Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Nov 6, 2023
1 parent 2a0c64a commit 4453cff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/app/icd/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ source_set("cluster") {
"ICDMonitoringTable.h",
]

deps = [ ":notifier" ]

public_deps = [
":notifier",
"${chip_root}/src/lib/core",
"${chip_root}/src/platform:platform",
"${chip_root}/src/protocols:im_status",
Expand Down
6 changes: 3 additions & 3 deletions src/app/icd/ICDManagementServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Status ICDManagementServer::RegisterClient(PersistentStorageDelegate & storage,
if (isFirstEntryForFabric)
{
// Notify subscribers that the first entry for the fabric was successfully added
app::ICDNotifier::GetInstance().BroadcastICDManagementEvent(app::ICDListener::ICDManagementEvents::kTableUpdated);
TriggerICDMTableUpdatedEvent();
}

return InteractionModel::Status::Success;
Expand Down Expand Up @@ -95,7 +95,7 @@ Status ICDManagementServer::UnregisterClient(PersistentStorageDelegate & storage

if (table.IsEmpty())
{
TableIsEmptyForFabric();
TriggerICDMTableUpdatedEvent();
}

return InteractionModel::Status::Success;
Expand All @@ -109,7 +109,7 @@ Status ICDManagementServer::StayActiveRequest(FabricIndex fabric_index)
return InteractionModel::Status::UnsupportedCommand;
}

void ICDManagementServer::TableIsEmptyForFabric()
void ICDManagementServer::TriggerICDMTableUpdatedEvent()
{
app::ICDNotifier::GetInstance().BroadcastICDManagementEvent(app::ICDListener::ICDManagementEvents::kTableUpdated);
}
Expand Down
6 changes: 5 additions & 1 deletion src/app/icd/ICDManagementServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ class ICDManagementServer
Status UnregisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id,
Optional<chip::ByteSpan> verificationKey, bool is_admin);

void TableIsEmptyForFabric();
/**
* @brief Triggers table update events to notify subscribers that an entry was added or removed
* from the ICDMonitoringTable.
*/
void TriggerICDMTableUpdatedEvent();

Status StayActiveRequest(FabricIndex fabric_index);

Expand Down

0 comments on commit 4453cff

Please sign in to comment.