mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 20:57:47 +00:00
[cli] store cli user commands in container and support list prepend (#8977)
Calls to otCliSetUserCommand overwrite the pointer user command list pointer each time it is invoked, which results in successive calls to otCliSetUserCommand replacing the previously registered command list instead of appending to it. This is particularly relevant for the posix platform in which the main function registers a set of posix specific commands without any way to extend the set. This commit replaces the command list pointer with a container of command lists associated with a registered context in order to support prepending the active list of user commands up to a configurable value which defaults to 1 to maintain current behavior.
This commit is contained in:
@@ -126,7 +126,7 @@ pseudo_reset:
|
||||
otAppCliInit(instance);
|
||||
|
||||
#if OPENTHREAD_POSIX && !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
|
||||
otCliSetUserCommands(kCommands, OT_ARRAY_LENGTH(kCommands), instance);
|
||||
IgnoreError(otCliSetUserCommands(kCommands, OT_ARRAY_LENGTH(kCommands), instance));
|
||||
#endif
|
||||
|
||||
while (!otSysPseudoResetWasRequested())
|
||||
|
||||
Reference in New Issue
Block a user