Skip to content

Commit

Permalink
Add remote bridge to local bridge after pairing
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Nov 11, 2024
1 parent fd42a49 commit e67188b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ void DeviceSynchronizer::StartDeviceSynchronization(Controller::DeviceController

mNodeId = nodeId;

ChipLogProgress(NotSpecified, "Start device synchronization for NodeId:" ChipLogFormatX64, ChipLogValueX64(mNodeId));

#if defined(PW_RPC_ENABLED)
mCurrentDeviceData = chip_rpc_SynchronizedDevice_init_default;
mCurrentDeviceData.has_id = true;
Expand Down
10 changes: 10 additions & 0 deletions examples/fabric-admin/rpc/RpcServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ class FabricAdmin final : public rpc::FabricAdmin, public admin::PairingDelegate
if (err == CHIP_NO_ERROR)
{
DeviceManager::Instance().SetRemoteBridgeNodeId(deviceId);

// We need to register the remote bridge device as a bridged device on the local bridge. This ensures that the ecosystem
// triggering the fabric sync process is notified of the successful reverse commissioning.
chip_rpc_SynchronizedDevice deviceData = chip_rpc_SynchronizedDevice_init_default;
deviceData.has_id = true;
deviceData.id.node_id = deviceId;
deviceData.id.fabric_index = PairingManager::Instance().CurrentCommissioner().GetFabricIndex();
deviceData.has_is_icd = true;
deviceData.is_icd = false;
AddSynchronizedDevice(deviceData);
}
else
{
Expand Down

0 comments on commit e67188b

Please sign in to comment.