From 882f7fba3c3594e66a7134b9d6722eedfdfce986 Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Fri, 3 Dec 2021 16:14:52 -0500 Subject: [PATCH] Remove needless OpcredsIssuer dependency (#12338) * Remove needless OpcredsIssuer dependency - Dependency on ExampleOperationalCredentialsIssuer was in many files where not needed, making other refactors more difficult. Remove this dependency and make CHIPCommand own its ephemeral operational credentials issuer. * Restyled by clang-format * Apply review comment * Fix merge issue Co-authored-by: Restyled.io Co-authored-by: Andrei Litvin --- examples/chip-tool/commands/clusters/ModelCommand.h | 1 - examples/chip-tool/commands/common/CHIPCommand.h | 4 +++- examples/chip-tool/commands/common/Command.h | 1 - examples/chip-tool/commands/common/Commands.h | 1 - examples/chip-tool/commands/discover/DiscoverCommand.h | 1 - examples/chip-tool/commands/reporting/ReportingCommand.h | 2 -- examples/chip-tool/commands/tests/TestCommand.h | 1 - 7 files changed, 3 insertions(+), 8 deletions(-) diff --git a/examples/chip-tool/commands/clusters/ModelCommand.h b/examples/chip-tool/commands/clusters/ModelCommand.h index b85adb2e9e552e..b03361433e0996 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.h b/examples/chip-tool/commands/common/CHIPCommand.h index 3a3da78b86895f..f1aeadbbffea81 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -18,6 +18,8 @@ #pragma once +#include + #include "../../config/PersistentStorage.h" #include "Command.h" @@ -69,6 +71,7 @@ class CHIPCommand : public Command PersistentStorage mDefaultStorage; PersistentStorage mCommissionerStorage; chip::SimpleFabricStorage mFabricStorage; + chip::Controller::ExampleOperationalCredentialsIssuer mOpCredsIssuer; std::string GetIdentity(); void SetIdentity(const char * name); @@ -88,7 +91,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 876afbe33bf415..806e205936b22f 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/reporting/ReportingCommand.h b/examples/chip-tool/commands/reporting/ReportingCommand.h index ca5f32409708bb..609e11daf602ba 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 c9ec34f2784caf..c314699e0e7a59 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