Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commissioning State Machine #13294

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8eede1f
Workaround for #12821, session ID collissions
msandstedt Dec 22, 2021
d6cb587
Add ability to emplace already-commissioned devices
msandstedt Dec 21, 2021
7342ddb
Add Commissioning State Machine
msandstedt Dec 19, 2021
1016a31
s/commissioner/controller in chip-tool
msandstedt Dec 22, 2021
3a33e96
Add git issue comment for missing TCP support
msandstedt Jan 6, 2022
512edad
per review comments, remove unused SharedString struct
msandstedt Jan 6, 2022
7e2712c
per review comments, add #13327 issue reference in TODO comment
msandstedt Jan 6, 2022
6c61476
restyle
msandstedt Jan 6, 2022
e4b87b5
per review comments, add #13170 issue reference in TODO comment
msandstedt Jan 6, 2022
006fc13
Revise for compatibility with #12657
msandstedt Jan 6, 2022
6e6cbdd
remove workarounds for #13327, fixed by #13321
msandstedt Jan 7, 2022
ef6f5bb
Revise for compatibility with #13330
msandstedt Jan 7, 2022
4b8884f
Remove workarounds for problems now addressed by #12794 and #13357
msandstedt Jan 7, 2022
220f2f8
per wbschiller, reduce number of #ifdefs in Commissionee.h
msandstedt Jan 10, 2022
dda7c17
per kianooshkarami, move BleDiscoverer and DnssdDiscoverer implementa…
msandstedt Jan 10, 2022
047da5c
per kianooshkarami, s/std::shared_ptr/Platform::SharedPtr
msandstedt Jan 10, 2022
9ce3a01
per kianooshkarami, don't leak exchange contexts on failure
msandstedt Jan 10, 2022
7016885
Add doc headers to Discoverer.h, change how onboarding payload is passed
msandstedt Jan 11, 2022
d9075b3
per turon, improve Event and State namespacing for clarity
msandstedt Jan 18, 2022
2c0cc48
update for compatibility with latest master
msandstedt Jan 27, 2022
6a11de7
fix VerifyOrExit lint error
msandstedt Jan 28, 2022
293922d
restyle
msandstedt Jan 28, 2022
0b10113
fixup merge with head of master
msandstedt Feb 1, 2022
51d91dc
Merge branch 'master' of https://github.com/project-chip/connectedhom…
msandstedt Feb 3, 2022
1374448
restyle
msandstedt Feb 3, 2022
1ad75e1
Merge branch 'master' of https://github.com/project-chip/connectedhom…
msandstedt Feb 3, 2022
a10482d
update for compatibility with #14417
msandstedt Feb 4, 2022
76bcc3c
per cecille, use CommissioningParameters to consume config from chip-…
msandstedt Feb 4, 2022
88f6151
remove unused Init interface
msandstedt Feb 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/chip-tool/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ static_library("chip-tool-utils") {
"${chip_root}/src/app/tests/suites/commands/log",
"${chip_root}/src/app/tests/suites/commands/system",
"${chip_root}/src/app/tests/suites/pics",
"${chip_root}/src/commissioner",
"${chip_root}/src/controller/data_model",
"${chip_root}/src/lib",
"${chip_root}/src/platform",
Expand Down
2 changes: 1 addition & 1 deletion examples/chip-tool/commands/clusters/ModelCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace ::chip;
CHIP_ERROR ModelCommand::RunCommand()
{
ChipLogProgress(chipTool, "Sending command to node 0x%" PRIx64, mNodeId);
return CurrentCommissioner().GetConnectedDevice(mNodeId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback);
return CurrentController().GetConnectedDevice(mNodeId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback);
}

void ModelCommand::OnDeviceConnectedFn(void * context, ChipDevice * device)
Expand Down
72 changes: 36 additions & 36 deletions examples/chip-tool/commands/common/CHIPCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ CHIP_ERROR CHIPCommand::Run()

chip::Controller::FactoryInitParams factoryInitParams;
factoryInitParams.fabricStorage = &mFabricStorage;
factoryInitParams.listenPort = static_cast<uint16_t>(mDefaultStorage.GetListenPort() + CurrentCommissionerId());
factoryInitParams.listenPort = static_cast<uint16_t>(mDefaultStorage.GetListenPort() + CurrentControllerId());
ReturnLogErrorOnFailure(DeviceControllerFactory::GetInstance().Init(factoryInitParams));

ReturnLogErrorOnFailure(InitializeCommissioner(kIdentityNull, kIdentityNullFabricId));
ReturnLogErrorOnFailure(InitializeCommissioner(kIdentityAlpha, kIdentityAlphaFabricId));
ReturnLogErrorOnFailure(InitializeCommissioner(kIdentityBeta, kIdentityBetaFabricId));
ReturnLogErrorOnFailure(InitializeCommissioner(kIdentityGamma, kIdentityGammaFabricId));
ReturnLogErrorOnFailure(InitializeController(kIdentityNull, kIdentityNullFabricId));
ReturnLogErrorOnFailure(InitializeController(kIdentityAlpha, kIdentityAlphaFabricId));
ReturnLogErrorOnFailure(InitializeController(kIdentityBeta, kIdentityBetaFabricId));
ReturnLogErrorOnFailure(InitializeController(kIdentityGamma, kIdentityGammaFabricId));

chip::DeviceLayer::PlatformMgr().ScheduleWork(RunQueuedCommand, reinterpret_cast<intptr_t>(this));
ReturnLogErrorOnFailure(StartWaiting(GetWaitDuration()));
Expand All @@ -67,10 +67,10 @@ CHIP_ERROR CHIPCommand::Run()
// since the CHIP thread and event queue have been stopped, preventing any thread
// races.
//
ReturnLogErrorOnFailure(ShutdownCommissioner(kIdentityNull));
ReturnLogErrorOnFailure(ShutdownCommissioner(kIdentityAlpha));
ReturnLogErrorOnFailure(ShutdownCommissioner(kIdentityBeta));
ReturnLogErrorOnFailure(ShutdownCommissioner(kIdentityGamma));
ReturnLogErrorOnFailure(ShutdownController(kIdentityNull));
ReturnLogErrorOnFailure(ShutdownController(kIdentityAlpha));
ReturnLogErrorOnFailure(ShutdownController(kIdentityBeta));
ReturnLogErrorOnFailure(ShutdownController(kIdentityGamma));

StopTracing();
return CHIP_NO_ERROR;
Expand Down Expand Up @@ -105,29 +105,29 @@ void CHIPCommand::SetIdentity(const char * identity)
if (name.compare(kIdentityAlpha) != 0 && name.compare(kIdentityBeta) != 0 && name.compare(kIdentityGamma) != 0 &&
name.compare(kIdentityNull) != 0)
{
ChipLogError(chipTool, "Unknown commissioner name: %s. Supported names are [%s, %s, %s]", name.c_str(), kIdentityAlpha,
ChipLogError(chipTool, "Unknown controller name: %s. Supported names are [%s, %s, %s]", name.c_str(), kIdentityAlpha,
kIdentityBeta, kIdentityGamma);
chipDie();
}

mCommissionerName.SetValue(const_cast<char *>(identity));
mControllerName.SetValue(const_cast<char *>(identity));
}

std::string CHIPCommand::GetIdentity()
{
std::string name = mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha;
std::string name = mControllerName.HasValue() ? mControllerName.Value() : kIdentityAlpha;
if (name.compare(kIdentityAlpha) != 0 && name.compare(kIdentityBeta) != 0 && name.compare(kIdentityGamma) != 0 &&
name.compare(kIdentityNull) != 0)
{
ChipLogError(chipTool, "Unknown commissioner name: %s. Supported names are [%s, %s, %s]", name.c_str(), kIdentityAlpha,
ChipLogError(chipTool, "Unknown controller name: %s. Supported names are [%s, %s, %s]", name.c_str(), kIdentityAlpha,
kIdentityBeta, kIdentityGamma);
chipDie();
}

return name;
}

chip::FabricId CHIPCommand::CurrentCommissionerId()
chip::FabricId CHIPCommand::CurrentControllerId()
{
chip::FabricId id;

Expand All @@ -150,35 +150,35 @@ chip::FabricId CHIPCommand::CurrentCommissionerId()
}
else
{
VerifyOrDieWithMsg(false, chipTool, "Unknown commissioner name: %s. Supported names are [%s, %s, %s]", name.c_str(),
VerifyOrDieWithMsg(false, chipTool, "Unknown controller name: %s. Supported names are [%s, %s, %s]", name.c_str(),
kIdentityAlpha, kIdentityBeta, kIdentityGamma);
}

return id;
}

chip::Controller::DeviceCommissioner & CHIPCommand::CurrentCommissioner()
chip::Controller::DeviceController & CHIPCommand::CurrentController()
{
auto item = mCommissioners.find(GetIdentity());
auto item = mControllers.find(GetIdentity());
return *item->second.get();
}

CHIP_ERROR CHIPCommand::ShutdownCommissioner(std::string key)
CHIP_ERROR CHIPCommand::ShutdownController(std::string key)
{
return mCommissioners[key].get()->Shutdown();
return mControllers[key].get()->Shutdown();
}

CHIP_ERROR CHIPCommand::InitializeCommissioner(std::string key, chip::FabricId fabricId)
CHIP_ERROR CHIPCommand::InitializeController(std::string key, chip::FabricId fabricId)
{
chip::Platform::ScopedMemoryBuffer<uint8_t> noc;
chip::Platform::ScopedMemoryBuffer<uint8_t> icac;
chip::Platform::ScopedMemoryBuffer<uint8_t> rcac;

std::unique_ptr<ChipDeviceCommissioner> commissioner = std::make_unique<ChipDeviceCommissioner>();
chip::Controller::SetupParams commissionerParams;
std::unique_ptr<ChipDeviceController> controller = std::make_unique<ChipDeviceController>();
chip::Controller::SetupParams controllerParams;

ReturnLogErrorOnFailure(mCredIssuerCmds->SetupDeviceAttestation(commissionerParams));
chip::Credentials::SetDeviceAttestationVerifier(commissionerParams.deviceAttestationVerifier);
ReturnLogErrorOnFailure(mCredIssuerCmds->SetupDeviceAttestation(controllerParams));
chip::Credentials::SetDeviceAttestationVerifier(controllerParams.deviceAttestationVerifier);

VerifyOrReturnError(noc.Alloc(chip::Controller::kMaxCHIPDERCertLength), CHIP_ERROR_NO_MEMORY);
VerifyOrReturnError(icac.Alloc(chip::Controller::kMaxCHIPDERCertLength), CHIP_ERROR_NO_MEMORY);
Expand All @@ -192,28 +192,28 @@ CHIP_ERROR CHIPCommand::InitializeCommissioner(std::string key, chip::FabricId f
// TODO - OpCreds should only be generated for pairing command
// store the credentials in persistent storage, and
// generate when not available in the storage.
ReturnLogErrorOnFailure(mCommissionerStorage.Init(key.c_str()));
ReturnLogErrorOnFailure(mCredIssuerCmds->InitializeCredentialsIssuer(mCommissionerStorage));
ReturnLogErrorOnFailure(mControllerStorage.Init(key.c_str()));
ReturnLogErrorOnFailure(mCredIssuerCmds->InitializeCredentialsIssuer(mControllerStorage));

chip::MutableByteSpan nocSpan(noc.Get(), chip::Controller::kMaxCHIPDERCertLength);
chip::MutableByteSpan icacSpan(icac.Get(), chip::Controller::kMaxCHIPDERCertLength);
chip::MutableByteSpan rcacSpan(rcac.Get(), chip::Controller::kMaxCHIPDERCertLength);

ReturnLogErrorOnFailure(ephemeralKey.Initialize());
ReturnLogErrorOnFailure(mCredIssuerCmds->GenerateControllerNOCChain(mCommissionerStorage.GetLocalNodeId(), fabricId,
ReturnLogErrorOnFailure(mCredIssuerCmds->GenerateControllerNOCChain(mControllerStorage.GetLocalNodeId(), fabricId,
ephemeralKey, rcacSpan, icacSpan, nocSpan));
commissionerParams.operationalKeypair = &ephemeralKey;
commissionerParams.controllerRCAC = rcacSpan;
commissionerParams.controllerICAC = icacSpan;
commissionerParams.controllerNOC = nocSpan;
controllerParams.operationalKeypair = &ephemeralKey;
controllerParams.controllerRCAC = rcacSpan;
controllerParams.controllerICAC = icacSpan;
controllerParams.controllerNOC = nocSpan;
}

commissionerParams.storageDelegate = &mCommissionerStorage;
commissionerParams.operationalCredentialsDelegate = mCredIssuerCmds->GetCredentialIssuer();
commissionerParams.controllerVendorId = chip::VendorId::TestVendor1;
controllerParams.storageDelegate = &mControllerStorage;
controllerParams.operationalCredentialsDelegate = mCredIssuerCmds->GetCredentialIssuer();
controllerParams.controllerVendorId = chip::VendorId::TestVendor1;

ReturnLogErrorOnFailure(DeviceControllerFactory::GetInstance().SetupCommissioner(commissionerParams, *(commissioner.get())));
mCommissioners[key] = std::move(commissioner);
ReturnLogErrorOnFailure(DeviceControllerFactory::GetInstance().SetupController(controllerParams, *(controller.get())));
mControllers[key] = std::move(controller);

return CHIP_NO_ERROR;
}
Expand Down
43 changes: 21 additions & 22 deletions examples/chip-tool/commands/common/CHIPCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,31 @@ class PersistentStorage;
constexpr const char kIdentityAlpha[] = "alpha";
constexpr const char kIdentityBeta[] = "beta";
constexpr const char kIdentityGamma[] = "gamma";
// The null fabric commissioner is a commissioner that isn't on a fabric.
// This is a legal configuration in which the commissioner delegates
// The null fabric controller is a controller that isn't on a fabric.
// This is a legal configuration in which the controller delegates
// operational communication and invocation of the commssioning complete
// command to a separate on-fabric administrator node.
//
// The null-fabric-commissioner identity is provided here to demonstrate the
// commissioner portion of such an architecture. The null-fabric-commissioner
// The null-fabric-controller identity is provided here to demonstrate the
// controller portion of such an architecture. The null-fabric-controller
// can carry a commissioning flow up until the point of operational channel
// (CASE) communcation.
constexpr const char kIdentityNull[] = "null-fabric-commissioner";
constexpr const char kIdentityNull[] = "null-fabric-controller";

class CHIPCommand : public Command
{
public:
using ChipDevice = ::chip::DeviceProxy;
using ChipDeviceCommissioner = ::chip::Controller::DeviceCommissioner;
using ChipDeviceController = ::chip::Controller::DeviceController;
using IPAddress = ::chip::Inet::IPAddress;
using NodeId = ::chip::NodeId;
using PeerId = ::chip::PeerId;
using PeerAddress = ::chip::Transport::PeerAddress;
using ChipDevice = ::chip::DeviceProxy;
using ChipDeviceController = ::chip::Controller::DeviceController;
using IPAddress = ::chip::Inet::IPAddress;
using NodeId = ::chip::NodeId;
using PeerId = ::chip::PeerId;
using PeerAddress = ::chip::Transport::PeerAddress;

CHIPCommand(const char * commandName, CredentialIssuerCommands * credIssuerCmds) :
Command(commandName), mCredIssuerCmds(credIssuerCmds)
{
AddArgument("commissioner-name", &mCommissionerName);
AddArgument("controller-name", &mControllerName);
#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED
AddArgument("trace_file", &mTraceFile);
AddArgument("trace_log", 0, 1, &mTraceLog);
Expand Down Expand Up @@ -88,24 +87,24 @@ class CHIPCommand : public Command
virtual void Shutdown() {}

PersistentStorage mDefaultStorage;
PersistentStorage mCommissionerStorage;
PersistentStorage mControllerStorage;
chip::SimpleFabricStorage mFabricStorage;
CredentialIssuerCommands * mCredIssuerCmds;

std::string GetIdentity();
void SetIdentity(const char * name);

// This method returns the commissioner instance to be used for running the command.
// The default commissioner instance name is "alpha", but it can be overridden by passing
// This method returns the controller instance to be used for running the command.
// The default controller instance name is "alpha", but it can be overridden by passing
// --identity "instance name" when running a command.
ChipDeviceCommissioner & CurrentCommissioner();
ChipDeviceController & CurrentController();

private:
CHIP_ERROR InitializeCommissioner(std::string key, chip::FabricId fabricId);
CHIP_ERROR ShutdownCommissioner(std::string key);
chip::FabricId CurrentCommissionerId();
std::map<std::string, std::unique_ptr<ChipDeviceCommissioner>> mCommissioners;
chip::Optional<char *> mCommissionerName;
CHIP_ERROR InitializeController(std::string key, chip::FabricId fabricId);
CHIP_ERROR ShutdownController(std::string key);
chip::FabricId CurrentControllerId();
std::map<std::string, std::unique_ptr<ChipDeviceController>> mControllers;
chip::Optional<char *> mControllerName;

static void RunQueuedCommand(intptr_t commandArg);

Expand Down
4 changes: 2 additions & 2 deletions examples/chip-tool/commands/discover/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class Update : public DiscoverCommand
CHIP_ERROR RunCommand(NodeId remoteId, uint64_t fabricId) override
{
ChipLogProgress(chipTool, "Mdns: Updating NodeId: %" PRIx64 " Compressed FabricId: %" PRIx64 " ...", remoteId,
CurrentCommissioner().GetCompressedFabricId());
return CurrentCommissioner().UpdateDevice(remoteId);
CurrentController().GetCompressedFabricId());
return CurrentController().UpdateDevice(remoteId);
}

/////////// DeviceAddressUpdateDelegate Interface /////////
Expand Down
2 changes: 1 addition & 1 deletion examples/chip-tool/commands/discover/DiscoverCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@

CHIP_ERROR DiscoverCommand::RunCommand()
{
CurrentCommissioner().RegisterDeviceAddressUpdateDelegate(this);
CurrentController().RegisterDeviceAddressUpdateDelegate(this);
return RunCommand(mNodeId, mFabricId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,26 @@
*/

#include "DiscoverCommissionablesCommand.h"
#include <controller/CHIPDeviceControllerFactory.h>
#include <lib/support/BytesToHex.h>

using namespace ::chip;

CHIP_ERROR DiscoverCommissionablesCommand::RunCommand()
{
CurrentCommissioner().RegisterDeviceDiscoveryDelegate(this);
ReturnErrorOnFailure(
mDnsResolver.Init(chip::Controller::DeviceControllerFactory::GetInstance().GetSystemState()->UDPEndPointManager()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just confirm that mDnsResolver supports multiple resolver delegates? If not, doesn't this displace the current commissioner as a resolver delegate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the controllers vended from the factory also do this. If that works, this will too. If that is broken, this is also broken.

Can you help me better understand the potential problem?

mDnsResolver.SetResolverDelegate(this);
Dnssd::DiscoveryFilter filter(Dnssd::DiscoveryFilterType::kNone, (uint64_t) 0);
return CurrentCommissioner().DiscoverCommissionableNodes(filter);
ReturnErrorOnFailure(mDnsResolver.FindCommissionableNodes(filter));
return CHIP_NO_ERROR;
}

void DiscoverCommissionablesCommand::OnDiscoveredDevice(const chip::Dnssd::DiscoveredNodeData & nodeData)
void DiscoverCommissionablesCommand::OnNodeDiscoveryComplete(const chip::Dnssd::DiscoveredNodeData & nodeData)
{
nodeData.LogDetail();
}

void DiscoverCommissionablesCommand::OnNodeIdResolved(const chip::Dnssd::ResolvedNodeData & nodeData) {}

void DiscoverCommissionablesCommand::OnNodeIdResolutionFailed(const PeerId & peerId, CHIP_ERROR error) {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,21 @@

#include "../common/CHIPCommand.h"

class DiscoverCommissionablesCommand : public CHIPCommand, public chip::Controller::DeviceDiscoveryDelegate
class DiscoverCommissionablesCommand : public CHIPCommand, public chip::Dnssd::ResolverDelegate
{
public:
DiscoverCommissionablesCommand(CredentialIssuerCommands * credsIssuerConfig) : CHIPCommand("commissionables", credsIssuerConfig)
{}

/////////// DeviceDiscoveryDelegate Interface /////////
void OnDiscoveredDevice(const chip::Dnssd::DiscoveredNodeData & nodeData) override;
/////////// ResolverDelegate Interface /////////
void OnNodeIdResolved(const chip::Dnssd::ResolvedNodeData & nodeData) override;
void OnNodeIdResolutionFailed(const PeerId & peerId, CHIP_ERROR error) override;
void OnNodeDiscoveryComplete(const chip::Dnssd::DiscoveredNodeData & nodeData) override;

/////////// CHIPCommand Interface /////////
CHIP_ERROR RunCommand() override;
chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(30); }

private:
chip::Dnssd::ResolverProxy mDnsResolver;
};
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ using namespace ::chip;

CHIP_ERROR DiscoverCommissionersCommand::RunCommand()
{
return mCommissionableNodeController.DiscoverCommissioners();
return mCommissionableNodeCommissioner.DiscoverCommissioners();
}

void DiscoverCommissionersCommand::Shutdown()
{
int commissionerCount = 0;
for (int i = 0; i < CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES; i++)
{
const Dnssd::DiscoveredNodeData * commissioner = mCommissionableNodeController.GetDiscoveredCommissioner(i);
const Dnssd::DiscoveredNodeData * commissioner = mCommissionableNodeCommissioner.GetDiscoveredCommissioner(i);
if (commissioner != nullptr)
{
ChipLogProgress(chipTool, "Discovered Commissioner #%d", commissionerCount);
ChipLogProgress(chipTool, "Discovered Commissioner#%d", commissionerCount);
commissioner->LogDetail();
commissionerCount++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ class DiscoverCommissionersCommand : public CHIPCommand
void Shutdown() override;

private:
chip::Controller::CommissionableNodeController mCommissionableNodeController;
chip::Controller::CommissionableNodeController mCommissionableNodeCommissioner;
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using namespace ::chip;

CHIP_ERROR OpenCommissioningWindowCommand::RunCommand()
{
return CurrentCommissioner().GetConnectedDevice(mNodeId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback);
return CurrentController().GetConnectedDevice(mNodeId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback);
}

void OpenCommissioningWindowCommand::OnDeviceConnectedFn(void * context, chip::OperationalDeviceProxy * device)
Expand Down Expand Up @@ -52,7 +52,7 @@ void OpenCommissioningWindowCommand::OnOpenCommissioningWindowResponse(void * co

CHIP_ERROR OpenCommissioningWindowCommand::OpenCommissioningWindow()
{
return CurrentCommissioner().OpenCommissioningWindowWithCallback(
mNodeId, mTimeout, mIteration, mDiscriminator, mCommissioningWindowOption, &mOnOpenCommissioningWindowCallback,
/* readVIDPIDAttributes */ true);
return CurrentController().OpenCommissioningWindowWithCallback(mNodeId, mTimeout, mIteration, mDiscriminator,
mCommissioningWindowOption, &mOnOpenCommissioningWindowCallback,
/* readVIDPIDAttributes */ true);
}
Loading