diff --git a/include/shell/shell_dummy.h b/include/shell/shell_dummy.h index e2af17fcd91..7d970121099 100644 --- a/include/shell/shell_dummy.h +++ b/include/shell/shell_dummy.h @@ -24,7 +24,7 @@ struct shell_dummy { size_t len; /** output buffer to collect shell output */ - char buf[300]; + char buf[CONFIG_SHELL_BACKEND_DUMMY_BUF_SIZE]; }; #define SHELL_DUMMY_DEFINE(_name) \ diff --git a/subsys/shell/Kconfig.backends b/subsys/shell/Kconfig.backends index dcdee1761d6..076aa2d4052 100644 --- a/subsys/shell/Kconfig.backends +++ b/subsys/shell/Kconfig.backends @@ -291,11 +291,21 @@ config SHELL_BACKEND_DUMMY Enable dummy backend which can be used to execute commands with no need for physical transport interface. +if SHELL_BACKEND_DUMMY + config SHELL_PROMPT_DUMMY string "Displayed prompt name" - depends on SHELL_BACKEND_DUMMY default "~$ " help Displayed prompt name for DUMMY backend. +config SHELL_BACKEND_DUMMY_BUF_SIZE + int "Size of dummy buffer size" + default 300 + help + This is size of output buffer that will be used by dummy backend, this limits number of + characters that will be captured from command output. + +endif # SHELL_BACKEND_DUMMY + endif # SHELL_BACKENDS diff --git a/subsys/shell/shell.c b/subsys/shell/shell.c index 5237d76e1e7..e58f5bd0098 100644 --- a/subsys/shell/shell.c +++ b/subsys/shell/shell.c @@ -8,7 +8,9 @@ #include #include #include +#if defined(CONFIG_SHELL_BACKEND_DUMMY) #include +#endif #include "shell_ops.h" #include "shell_help.h" #include "shell_utils.h"