Skip to content

Commit e42ba4f

Browse files
yufengwangcaArekBalysNordic
authored andcommitted
Fix fabric-bridge is accidentally added into sync list (#35132)
1 parent ef21238 commit e42ba4f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

examples/fabric-admin/commands/pairing/DeviceSynchronization.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include <app-common/zap-generated/ids/Attributes.h>
2626
#include <app-common/zap-generated/ids/Clusters.h>
27+
#include <device_manager/DeviceManager.h>
2728

2829
using namespace ::chip;
2930
using namespace ::chip::app;
@@ -120,7 +121,10 @@ void DeviceSynchronizer::OnReportEnd()
120121
{
121122
// Report end is at the end of all attributes (success)
122123
#if defined(PW_RPC_ENABLED)
123-
AddSynchronizedDevice(mCurrentDeviceData);
124+
if (!DeviceMgr().IsCurrentBridgeDevice(mCurrentDeviceData.node_id))
125+
{
126+
AddSynchronizedDevice(mCurrentDeviceData);
127+
}
124128
#else
125129
ChipLogError(NotSpecified, "Cannot synchronize device with fabric bridge: RPC not enabled");
126130
#endif

examples/fabric-admin/device_manager/DeviceManager.h

+9
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ class DeviceManager : public PairingDelegate
7575

7676
void RemoveSyncedDevice(chip::NodeId nodeId);
7777

78+
/**
79+
* @brief Determines whether a given nodeId corresponds to the "current bridge device," either local or remote.
80+
*
81+
* @param nodeId The ID of the node being checked.
82+
*
83+
* @return true if the nodeId matches either the local or remote bridge device; otherwise, false.
84+
*/
85+
bool IsCurrentBridgeDevice(chip::NodeId nodeId) const { return nodeId == mLocalBridgeNodeId || nodeId == mRemoteBridgeNodeId; }
86+
7887
/**
7988
* @brief Open the commissioning window for a specific device within its own fabric.
8089
*

0 commit comments

Comments
 (0)