From fdb8190f502cc36a72bb83bacbd4f21c28c4fb0f Mon Sep 17 00:00:00 2001 From: Ashish <104561745+aashu216@users.noreply.github.com> Date: Mon, 6 Jan 2025 23:05:07 +0530 Subject: [PATCH] [ot-fct] fix access file from path defined in build parameter (#11080) When configuration file defined in build parameter(command line argument), ot-fct is wound't take into an account and accessed default path. This commit fixes to access configuration file from path which is defined from build command line parameter. Also, it fixes some compilation issues while building from ot-br-posix. Signed-off-by: ashish --- tools/ot-fct/CMakeLists.txt | 6 ++++++ tools/ot-fct/cli.cpp | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/ot-fct/CMakeLists.txt b/tools/ot-fct/CMakeLists.txt index 7097e624d..decdb6cf2 100644 --- a/tools/ot-fct/CMakeLists.txt +++ b/tools/ot-fct/CMakeLists.txt @@ -48,3 +48,9 @@ add_executable(ot-fct ${OPENTHREAD_DIR}/src/posix/platform/power.cpp ${OPENTHREAD_DIR}/src/posix/platform/config_file.cpp ) + +set(OT_POSIX_PRODUCT_CONFIG "" CACHE STRING "OpenThread product config file") + +if (OT_POSIX_PRODUCT_CONFIG) + target_compile_options(ot-fct PRIVATE -DOPENTHREAD_POSIX_CONFIG_PRODUCT_CONFIG_FILE=\"${OT_POSIX_PRODUCT_CONFIG}\") +endif() diff --git a/tools/ot-fct/cli.cpp b/tools/ot-fct/cli.cpp index 893e595b4..e8bae302a 100644 --- a/tools/ot-fct/cli.cpp +++ b/tools/ot-fct/cli.cpp @@ -88,7 +88,6 @@ otError Cli::GetNextDomain(int &aIterator, Power::Domain &aDomain) break; } -exit: return error; } @@ -123,8 +122,6 @@ otError Cli::ProcessRegionDomainTable(Utils::CmdLineParser::Arg aArgs[]) otError error = OT_ERROR_NONE; int iterator = 0; char value[kMaxValueSize]; - char *domain; - char *psave; VerifyOrExit(aArgs[0].IsEmpty(), error = OT_ERROR_INVALID_ARGS); @@ -277,7 +274,7 @@ exit: void Cli::ProcessCommand(Utils::CmdLineParser::Arg aArgs[]) { otError error = OT_ERROR_NOT_FOUND; - int i; + size_t i; for (i = 0; i < (sizeof(sCommands) / sizeof(sCommands[0])); i++) { @@ -288,7 +285,6 @@ void Cli::ProcessCommand(Utils::CmdLineParser::Arg aArgs[]) } } -exit: AppendErrorResult(error); }