1# Copyright Runtime.io 2018. All rights reserved.
2# Copyright Nordic Semiconductor ASA 2020-2022. All rights reserved.
3# SPDX-License-Identifier: Apache-2.0
4
5# The Kconfig file is dedicated to Shell management group of
6# of MCUmgr subsystem and provides Kconfig options to configure
7# group commands behaviour and other aspects.
8#
9# Options defined in this file should be prefixed:
10#  MCUMGR_GRP_SHELL_ -- general group options;
11#
12# When adding Kconfig options, that control the same feature,
13# try to group them together by the same stem after prefix.
14
15menuconfig MCUMGR_GRP_SHELL
16	bool "Mcumgr handlers for shell management"
17	depends on SHELL
18	depends on SHELL_BACKEND_DUMMY
19	select MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_2
20	help
21	  Enables MCUmgr handlers for shell management. The handler will utilize
22	  the dummy backend to execute shell commands and capture the output to
23	  an internal memory buffer. This way, there is no interaction with
24	  physical interfaces outside of the scope of the user.
25	  It is possible to use additional shell backends in coordination
26	  with this handler and they will not interfere.
27	  The MCUMGR_GRP_SHELL_BACKEND_DUMMY_BUF_SIZE will affect how many characters
28	  will be returned from command output, if your output gets cut, then
29	  increase the value. Remember to set MCUMGR_TRANSPORT_NETBUF_SIZE accordingly.
30	  Note that maximum length of shell command accepted is regulated by
31	  the CONFIG_SHELL_CMD_BUFF_SIZE, and a buffer for a command is allocated
32	  on a stack, by the MCUmgr, so enabling MCUMGR_GRP_SHELL and
33	  changes to the CONFIG_SHELL_CMD_BUFF_SIZE may increase stack size
34	  requirements.
35
36if MCUMGR_GRP_SHELL
37
38# Show dummy shell buffer size here, will show help text of original prompt so
39# nothing extra is needed here, nor a default value.
40config SHELL_BACKEND_DUMMY_BUF_SIZE
41	int "Shell output buffer size (Size of dummy buffer size)"
42
43config MCUMGR_GRP_SHELL_LEGACY_RC_RETURN_CODE
44	bool "Legacy behaviour: Use rc field for shell function return code"
45	help
46	  Enabling this options brings back legacy behaviour where the shell
47	  return code is returned, incorrectly, in the rc field that was
48	  originally designated for returning SMP processing errors. When
49	  disabled, there will be an additional ret field which contains the
50	  shell command exit code, and rc will be used for SMP processing
51	  error codes.
52
53module = MCUMGR_GRP_SHELL
54module-str = mcumgr_grp_shell
55source "subsys/logging/Kconfig.template.log_config"
56
57endif # MCUMGR_GRP_SHELL
58