From 704a2ec09c7d826fe79b4ceb57c0a392fc625fbc Mon Sep 17 00:00:00 2001 From: Song GUO Date: Tue, 12 Dec 2023 11:04:57 +0800 Subject: [PATCH] [icd] integrate ICD management command into CHIP tool (#30863) * [icd] integrate ICD management command into CHIP tool * Delete entry on failure * Fix build --- examples/chip-tool/BUILD.gn | 2 -- examples/chip-tool/commands/common/CHIPCommand.cpp | 6 ++++++ examples/chip-tool/commands/common/CHIPCommand.h | 2 -- examples/tv-casting-app/tv-casting-common/BUILD.gn | 1 - 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index 7b7b43828626d4..7a0b440ad536dc 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -102,9 +102,7 @@ static_library("chip-tool-utils") { public_deps = [ "${chip_root}/examples/common/tracing:commandline", - "${chip_root}/src/app/icd/client:handler", "${chip_root}/src/app/icd/client:manager", - "${chip_root}/src/app/icd/client:handler", "${chip_root}/src/app/server", "${chip_root}/src/app/tests/suites/commands/interaction_model", "${chip_root}/src/controller/data_model", diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index 52b3ec698f73df..06dcd16d02a450 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -110,6 +110,12 @@ CHIP_ERROR CHIPCommand::MaybeSetUpStack() // TODO: Implement persistent ICD storage for the chip-tool. ReturnLogErrorOnFailure(sICDClientStorage.Init(&mDefaultStorage, &sSessionKeystore)); + // chip-tool uses a non-persistent keystore. + // ICD storage lifetime is currently tied to the chip-tool's lifetime. Since chip-tool interactive mode is currently used for + // ICD commissioning and check-in validation, this temporary storage meets the test requirements. + // TODO: Implement persistent ICD storage for the chip-tool. + ReturnLogErrorOnFailure(sICDClientStorage.Init(&mDefaultStorage, &sSessionKeystore)); + chip::Controller::FactoryInitParams factoryInitParams; factoryInitParams.fabricIndependentStorage = &mDefaultStorage; diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h index 2ca335c66d109c..9b530b16e9c874 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -25,8 +25,6 @@ #include "Command.h" #include -#include -#include #include #include #include diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn index 8a2d6767b2b39a..c5ad03964cb0d9 100644 --- a/examples/tv-casting-app/tv-casting-common/BUILD.gn +++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn @@ -110,7 +110,6 @@ chip_data_model("tv-casting-common") { deps = [ "${chip_root}/examples/common/tracing:commandline", - "${chip_root}/src/app/icd/client:handler", "${chip_root}/src/app/icd/client:manager", "${chip_root}/src/app/tests/suites/commands/interaction_model", "${chip_root}/src/lib/support/jsontlv",