Skip to content

Commit

Permalink
Add to bridge if it is not the local bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Nov 11, 2024
1 parent 67af91b commit ceb3042
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions examples/fabric-admin/device_manager/DeviceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ class DeviceManager
*/
bool IsCurrentBridgeDevice(chip::NodeId nodeId) const { return nodeId == mLocalBridgeNodeId || nodeId == mRemoteBridgeNodeId; }

/**
* @brief Determines whether a given nodeId corresponds to the "current local bridge device".
*
* @param nodeId The ID of the node being checked.
*
* @return true if the nodeId matches the local bridge device; otherwise, false.
*/
bool IsLocalBridgeDevice(chip::NodeId nodeId) const { return nodeId == mLocalBridgeNodeId; }

/**
* @brief Open the commissioning window for a specific device within its own fabric.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void DeviceSynchronizer::OnReportEnd()
void DeviceSynchronizer::OnDone(app::ReadClient * apReadClient)
{
#if defined(PW_RPC_ENABLED)
if (mState == State::ReceivedResponse && !DeviceManager::Instance().IsCurrentBridgeDevice(mNodeId))
if (mState == State::ReceivedResponse && !DeviceManager::Instance().IsLocalBridgeDevice(mNodeId))
{
GetUniqueId();
if (mState == State::GettingUid)
Expand Down

0 comments on commit ceb3042

Please sign in to comment.