diff --git a/examples/chip-tool/commands/clusters/ModelCommand.h b/examples/chip-tool/commands/clusters/ModelCommand.h index 71f79d4a2b3b08..422db20bf382c0 100644 --- a/examples/chip-tool/commands/clusters/ModelCommand.h +++ b/examples/chip-tool/commands/clusters/ModelCommand.h @@ -21,7 +21,6 @@ #include "../../config/PersistentStorage.h" #include "../common/CHIPCommand.h" #include -#include #include class ModelCommand : public CHIPCommand diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index 7f39cab591b99b..d4209da6c13548 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -18,6 +18,7 @@ #include "CHIPCommand.h" +#include "controller/ExampleOperationalCredentialsIssuer.h" #include #include #include @@ -31,13 +32,15 @@ using DeviceControllerFactory = chip::Controller::DeviceControllerFactory; CHIP_ERROR CHIPCommand::Run() { + chip::Controller::ExampleOperationalCredentialsIssuer opCredsIssuer; + #if CHIP_DEVICE_LAYER_TARGET_LINUX && CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE // By default, Linux device is configured as a BLE peripheral while the controller needs a BLE central. ReturnLogErrorOnFailure(chip::DeviceLayer::Internal::BLEMgrImpl().ConfigureBle(0, true)); #endif ReturnLogErrorOnFailure(mStorage.Init()); - ReturnLogErrorOnFailure(mOpCredsIssuer.Initialize(mStorage)); + ReturnLogErrorOnFailure(opCredsIssuer.Initialize(mStorage)); ReturnLogErrorOnFailure(mFabricStorage.Initialize(&mStorage)); chip::Platform::ScopedMemoryBuffer noc; @@ -64,8 +67,8 @@ CHIP_ERROR CHIPCommand::Run() // TODO - OpCreds should only be generated for pairing command // store the credentials in persistent storage, and // generate when not available in the storage. - ReturnLogErrorOnFailure(mOpCredsIssuer.GenerateNOCChainAfterValidation(mStorage.GetLocalNodeId(), mStorage.GetFabricId(), - ephemeralKey.Pubkey(), rcacSpan, icacSpan, nocSpan)); + ReturnLogErrorOnFailure(opCredsIssuer.GenerateNOCChainAfterValidation(mStorage.GetLocalNodeId(), mStorage.GetFabricId(), + ephemeralKey.Pubkey(), rcacSpan, icacSpan, nocSpan)); chip::Controller::FactoryInitParams factoryInitParams; factoryInitParams.fabricStorage = &mFabricStorage; @@ -73,7 +76,7 @@ CHIP_ERROR CHIPCommand::Run() chip::Controller::SetupParams commissionerParams; commissionerParams.storageDelegate = &mStorage; - commissionerParams.operationalCredentialsDelegate = &mOpCredsIssuer; + commissionerParams.operationalCredentialsDelegate = &opCredsIssuer; commissionerParams.ephemeralKeypair = &ephemeralKey; commissionerParams.controllerRCAC = rcacSpan; commissionerParams.controllerICAC = icacSpan; diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h index 51f3aab0994948..eeeb95c8460298 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -70,7 +70,6 @@ class CHIPCommand : public Command static void RunQueuedCommand(intptr_t commandArg); CHIP_ERROR mCommandExitStatus = CHIP_ERROR_INTERNAL; - chip::Controller::ExampleOperationalCredentialsIssuer mOpCredsIssuer; CHIP_ERROR StartWaiting(chip::System::Clock::Timeout seconds); void StopWaiting(); diff --git a/examples/chip-tool/commands/common/Command.h b/examples/chip-tool/commands/common/Command.h index 9cbac4ba0c6ade..1857db7f737f45 100644 --- a/examples/chip-tool/commands/common/Command.h +++ b/examples/chip-tool/commands/common/Command.h @@ -18,7 +18,6 @@ #pragma once -#include "controller/ExampleOperationalCredentialsIssuer.h" #include #include #include diff --git a/examples/chip-tool/commands/common/Commands.h b/examples/chip-tool/commands/common/Commands.h index cc1d027ba987b7..90dabbe33f6dc7 100644 --- a/examples/chip-tool/commands/common/Commands.h +++ b/examples/chip-tool/commands/common/Commands.h @@ -20,7 +20,6 @@ #include "../../config/PersistentStorage.h" #include "Command.h" -#include #include class Commands diff --git a/examples/chip-tool/commands/discover/DiscoverCommand.h b/examples/chip-tool/commands/discover/DiscoverCommand.h index 6e651a5fc94c8a..67d34b086b62ad 100644 --- a/examples/chip-tool/commands/discover/DiscoverCommand.h +++ b/examples/chip-tool/commands/discover/DiscoverCommand.h @@ -20,7 +20,6 @@ #include "../../config/PersistentStorage.h" #include "../common/CHIPCommand.h" -#include class DiscoverCommand : public CHIPCommand, public chip::Controller::DeviceAddressUpdateDelegate { diff --git a/examples/chip-tool/commands/pairing/PairingCommand.h b/examples/chip-tool/commands/pairing/PairingCommand.h index 2dc38bac1c35af..e481163ded7c95 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.h +++ b/examples/chip-tool/commands/pairing/PairingCommand.h @@ -23,7 +23,6 @@ #include #include -#include #include #include #include diff --git a/examples/chip-tool/commands/reporting/ReportingCommand.h b/examples/chip-tool/commands/reporting/ReportingCommand.h index 4547f256926167..232f831ba0c87b 100644 --- a/examples/chip-tool/commands/reporting/ReportingCommand.h +++ b/examples/chip-tool/commands/reporting/ReportingCommand.h @@ -21,8 +21,6 @@ #include "../../config/PersistentStorage.h" #include "../common/CHIPCommand.h" -#include - class ReportingCommand : public CHIPCommand { public: diff --git a/examples/chip-tool/commands/tests/TestCommand.h b/examples/chip-tool/commands/tests/TestCommand.h index 76206a324267c9..b67dbbee290630 100644 --- a/examples/chip-tool/commands/tests/TestCommand.h +++ b/examples/chip-tool/commands/tests/TestCommand.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include