Replies: 1 comment 4 replies
-
Hello, I'm chiming in as I am in the process of planning similar work. I appreciate the description of your solution, and I think that there is merit to consider it, but I will also mention my thoughts on the topic before this proposal. I have been considering the I appreciate that this is a more explicitly direct method of showcasing that vendor cli commands are supported, and I appreciate that the implementation description matches other standard references in the codebase. The one point that is outwardly different from the approach that I'm considering so far, is the Thank you for starting this discussion. Supporting vendor cli commands is a topic that is very relevant to my use case at the moment, and I would be very interested in seeing additional perspectives and engagement. |
Beta Was this translation helpful? Give feedback.
-
Goal and Background
The goal is to make it easier for vendors to build a test app with additional functions of their own based on the CLI app.
Describe the solution you'd like
Similar as what we did to support extension in NCP. Will make these changes:
CmdEntry("ext")
in the listkCommands
in the Cli module. The entry will be guarded by a switchOPENTHREAD_CONFIG_CLI_EXTENSION
.cli_ext.hpp
andcli_ext.cpp
. Similar as other cli modules, there will be a new classCliExtension
which inheritsOutput
. Implement theProcess
method with a dummy implementation. The two files should keep unchanged in OT. Vendors can change it in their internal code.OT_NCP_VENDOR_HOOK_SOURCE
for ncp in CMake to allow vendors to add more source files. That won't be a big problem.Why not using
otCliSetUserCommands
for vendors to add extensions?otCliSetUserCommands
is used in themain.c
of cli app and posix app. So an extension is required in both apps, then we need to add some code twice, also for the changes in build files.otCliSetUserCommands
is already used in cli app and posix app, it's hard to make it extendable becausekCommands
has been defined.Thoughs? @abtink @jwhui
Beta Was this translation helpful? Give feedback.
All reactions