blob: 7e03df3fd60f5102777e765df2352d65cfcdd1a1 [file] [log] [blame]
# Copyright Runtime.io 2018. All rights reserved.
# Copyright Nordic Semiconductor ASA 2020-2022. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
menuconfig MCUMGR_CMD_SHELL_MGMT
bool "Mcumgr handlers for shell management"
depends on SHELL
select SHELL_BACKEND_DUMMY
select MGMT_MIN_DECODING_LEVEL_2
help
Enables mcumgr handlers for shell management. The handler will utilize
the dummy backend to execute shell commands and capture the output to
an internal memory buffer. This way, there is no interaction with
physical interfaces outside of the scope of the user.
It is possible to use additional shell backends in coordination
with this handler and they will not interfere.
The SHELL_BACKEND_DUMMY_BUF_SIZE will affect how many characters
will be returned from command output, if your output gets cut, then
increase the value. Remember to set MCUMGR_BUF_SIZE accordingly.
Note that maximum length of shell command accepted is regulated by
the CONFIG_SHELL_CMD_BUFF_SIZE, and a buffer for a command is allocated
on a stack, by the mcumgr, so enabling MCUMGR_CMD_SHELL_MGMT and
changes to the CONFIG_SHELL_CMD_BUFF_SIZE may increase stack size
requirements.
if MCUMGR_CMD_SHELL_MGMT
# Show dummy shell buffer size here, will show help text of original prompt so
# nothing extra is needed here, nor a default value.
config SHELL_BACKEND_DUMMY_BUF_SIZE
int "Shell output buffer size (Size of dummy buffer size)"
config MCUMGR_CMD_SHELL_MGMT_LEGACY_RC_RETURN_CODE
bool "Legacy behaviour: Use rc field for shell function return code"
help
Enabling this options brings back legacy behaviour where the shell
return code is returned, incorrectly, in the rc field that was
originally designated for returning SMP processing errors. When
disabled, there will be an additional ret field which contains the
shell command exit code, and rc will be used for SMP processing
error codes.
endif # MCUMGR_CMD_SHELL_MGMT