Skip to content

Commit

Permalink
[Fabric-Sync] Fix ICD check-in handler registration (project-chip#36834)
Browse files Browse the repository at this point in the history
The fabric-sync app enables commissioner commissionee code. When doing
so, we have two exchange managers registered due to a common platform
code. In such case the default exchange is the server one, not the
controller one.
  • Loading branch information
arkq authored Dec 13, 2024
1 parent 2b8f5d7 commit d961628
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/fabric-sync/admin/FabricAdmin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
*/

#include "FabricAdmin.h"

#include <AppMain.h>
#include <CommissionerMain.h>
#include <app/server/Server.h>
#include <bridge/include/FabricBridge.h>
#include <controller/CHIPDeviceControllerFactory.h>

Expand Down Expand Up @@ -45,9 +47,8 @@ CHIP_ERROR FabricAdmin::Init()
VerifyOrReturnError(engine != nullptr, CHIP_ERROR_INCORRECT_STATE);
ReturnLogErrorOnFailure(IcdManager::Instance().Init(&sICDClientStorage, engine));

auto exchangeMgr = Controller::DeviceControllerFactory::GetInstance().GetSystemState()->ExchangeMgr();
VerifyOrReturnError(exchangeMgr != nullptr, CHIP_ERROR_INCORRECT_STATE);
ReturnLogErrorOnFailure(sCheckInHandler.Init(exchangeMgr, &sICDClientStorage, &IcdManager::Instance(), engine));
ReturnLogErrorOnFailure(sCheckInHandler.Init(&chip::Server::GetInstance().GetExchangeManager(), &sICDClientStorage,
&IcdManager::Instance(), engine));

ReturnLogErrorOnFailure(PairingManager::Instance().Init(GetDeviceCommissioner()));

Expand Down

0 comments on commit d961628

Please sign in to comment.