Skip to content

Commit

Permalink
CommissioningWindowManager should only listen for platform events whe…
Browse files Browse the repository at this point in the history
…n a commissioning window is open. (#28311)

Right now, a CommissioningWindowManager starts listening for platform events if
a commissioning window is opened, and then never stops.  That means it can end
up reacting to fail-safe expirations that have nothing to do with a
commissioning window (e.g. CASE updates of state that needs a fail-safe).

The fix is to not listen for platform events if the commissioning window is
closed.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Aug 22, 2023
1 parent 5922f09 commit a37b185
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/server/CommissioningWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ void CommissioningWindowManager::ResetState()

DeviceLayer::SystemLayer().CancelTimer(HandleCommissioningWindowTimeout, this);
mCommissioningTimeoutTimerArmed = false;

DeviceLayer::PlatformMgr().RemoveEventHandler(OnPlatformEventWrapper, reinterpret_cast<intptr_t>(this));
}

void CommissioningWindowManager::Cleanup()
Expand Down

0 comments on commit a37b185

Please sign in to comment.