Skip to content

Commit 10483a7

Browse files
update chef force check-in command with shutdown all subs
1 parent 79da246 commit 10483a7

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

examples/common/pigweed/rpc_services/Device.h

+1
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>
485485
virtual pw::Status TriggerIcdCheckin(const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
486486
{
487487
#if CHIP_CONFIG_ENABLE_ICD_CIP
488+
chip::app::InteractionModelEngine::GetInstance()->ShutdownAllSubscriptions();
488489
chip::DeviceLayer::PlatformMgr().ScheduleWork(
489490
[](intptr_t) {
490491
ChipLogDetail(AppServer, "Being triggerred to send ICD check-in message to subscriber");

src/app/InteractionModelEngine.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,18 @@ void InteractionModelEngine::ShutdownAllSubscriptions()
387387
ShutdownMatchingSubscriptions();
388388
}
389389

390+
void InteractionModelEngine::ShutdownAllSubscriptionHandlers()
391+
{
392+
mReadHandlers.ForEachActiveObject([&](auto * handler) {
393+
if (!handler->IsType(ReadHandler::InteractionType::Subscribe))
394+
{
395+
return Loop::Continue;
396+
}
397+
handler->Close();
398+
return Loop::Continue;
399+
});
400+
}
401+
390402
void InteractionModelEngine::ShutdownMatchingSubscriptions(const Optional<FabricIndex> & aFabricIndex,
391403
const Optional<NodeId> & aPeerNodeId)
392404
{

0 commit comments

Comments
 (0)