Skip to content

Commit

Permalink
[ot-fct] fix access file from path defined in build parameter (openth…
Browse files Browse the repository at this point in the history
…read#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 <[email protected]>
  • Loading branch information
aashu216 authored Jan 6, 2025
1 parent 93f6d61 commit fdb8190
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 6 additions & 0 deletions tools/ot-fct/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
6 changes: 1 addition & 5 deletions tools/ot-fct/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ otError Cli::GetNextDomain(int &aIterator, Power::Domain &aDomain)
break;
}

exit:
return error;
}

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -277,7 +274,7 @@ otError Cli::ProcessCalibrationTable(Utils::CmdLineParser::Arg aArgs[])
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++)
{
Expand All @@ -288,7 +285,6 @@ void Cli::ProcessCommand(Utils::CmdLineParser::Arg aArgs[])
}
}

exit:
AppendErrorResult(error);
}

Expand Down

0 comments on commit fdb8190

Please sign in to comment.