blob: a5a265330dc32dea1825a0d68ac8da7f6d80750a [file] [log] [blame]
# Shell backends configuration options
# Copyright (c) 2018 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
menuconfig SHELL_BACKENDS
bool "Shell backends"
default y
help
Enable shell backends.
if SHELL_BACKENDS
# Workaround for not being able to have commas in macro arguments
DT_CHOSEN_Z_SHELL_UART := zephyr,shell-uart
config SHELL_BACKEND_SERIAL
bool "Serial backend"
default "$(dt_chosen_enabled,$(DT_CHOSEN_Z_SHELL_UART))" if HAS_DTS
default y if !HAS_DTS
select SERIAL
select RING_BUFFER
help
Enable serial backend.
if SHELL_BACKEND_SERIAL
config SHELL_BACKEND_SERIAL_INIT_PRIORITY
int "Initialization priority"
default 0
range 0 99
help
Initialization priority for UART backend. This must be bigger than
the initialization priority of the used serial device.
config SHELL_PROMPT_UART
string "Displayed prompt name"
default "uart:~$ "
help
Displayed prompt name for UART backend.
# Internal config to enable UART interrupts if supported.
config SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN
bool "Interrupt driven"
default y
depends on SERIAL_SUPPORT_INTERRUPT
select UART_INTERRUPT_DRIVEN
config SHELL_BACKEND_SERIAL_TX_RING_BUFFER_SIZE
int "Set TX ring buffer size"
default 8
depends on SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN
help
If UART is utilizing DMA transfers then increasing ring buffer size
increases transfers length and reduces number of interrupts.
config SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE
int "Set RX ring buffer size"
default 64
help
RX ring buffer size impacts accepted latency of handling incoming
bytes by shell. If shell input is coming from the keyboard then it is
usually enough if ring buffer is few bytes (more than one due to
escape sequences). However, if bulk data is transferred it may be
required to increase it.
config SHELL_BACKEND_SERIAL_RX_POLL_PERIOD
int "RX polling period (in milliseconds)"
default 10
depends on !SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN
help
Determines how often UART is polled for RX byte.
config SHELL_BACKEND_SERIAL_CHECK_DTR
bool "Check DTR signal before TX"
depends on UART_LINE_CTRL
help
Check DTR signal before TX.
module = SHELL_BACKEND_SERIAL
default-timeout = 100
source "subsys/shell/Kconfig.template.shell_log_queue_timeout"
default-size = 10
source "subsys/shell/Kconfig.template.shell_log_queue_size"
choice
prompt "Initial log level limit"
default SHELL_BACKEND_SERIAL_LOG_LEVEL_DEFAULT
config SHELL_BACKEND_SERIAL_LOG_LEVEL_DEFAULT
bool "System limit (LOG_MAX_LEVEL)"
config SHELL_BACKEND_SERIAL_LOG_LEVEL_DBG
bool "Debug"
config SHELL_BACKEND_SERIAL_LOG_LEVEL_INF
bool "Info"
config SHELL_BACKEND_SERIAL_LOG_LEVEL_WRN
bool "Warning"
config SHELL_BACKEND_SERIAL_LOG_LEVEL_ERR
bool "Error"
config SHELL_BACKEND_SERIAL_LOG_LEVEL_NONE
bool "None"
endchoice
config SHELL_BACKEND_SERIAL_LOG_LEVEL
int
default 0 if SHELL_BACKEND_SERIAL_LOG_LEVEL_NONE
default 1 if SHELL_BACKEND_SERIAL_LOG_LEVEL_ERR
default 2 if SHELL_BACKEND_SERIAL_LOG_LEVEL_WRN
default 3 if SHELL_BACKEND_SERIAL_LOG_LEVEL_INF
default 4 if SHELL_BACKEND_SERIAL_LOG_LEVEL_DBG
default 5 if SHELL_BACKEND_SERIAL_LOG_LEVEL_DEFAULT
endif # SHELL_BACKEND_SERIAL
config SHELL_BACKEND_RTT
bool "RTT backend"
select CONSOLE
select RTT_CONSOLE
depends on USE_SEGGER_RTT
help
Enable RTT backend.
if SHELL_BACKEND_RTT
config SHELL_PROMPT_RTT
string "Displayed prompt name"
default "rtt:~$ "
help
Displayed prompt name for RTT backend.
config SHELL_RTT_RX_POLL_PERIOD
int "RX polling period (in milliseconds)"
default 10
help
Determines how often RTT is polled for RX byte.
module = SHELL_BACKEND_RTT
default-timeout = 100
source "subsys/shell/Kconfig.template.shell_log_queue_timeout"
default-size = 10
source "subsys/shell/Kconfig.template.shell_log_queue_size"
choice
prompt "Initial log level limit"
default SHELL_RTT_INIT_LOG_LEVEL_DEFAULT
config SHELL_RTT_INIT_LOG_LEVEL_DEFAULT
bool "System limit (LOG_MAX_LEVEL)"
config SHELL_RTT_INIT_LOG_LEVEL_DBG
bool "Debug"
config SHELL_RTT_INIT_LOG_LEVEL_INF
bool "Info"
config SHELL_RTT_INIT_LOG_LEVEL_WRN
bool "Warning"
config SHELL_RTT_INIT_LOG_LEVEL_ERR
bool "Error"
config SHELL_RTT_INIT_LOG_LEVEL_NONE
bool "None"
endchoice
config SHELL_RTT_INIT_LOG_LEVEL
int
default 0 if SHELL_RTT_INIT_LOG_LEVEL_NONE
default 1 if SHELL_RTT_INIT_LOG_LEVEL_ERR
default 2 if SHELL_RTT_INIT_LOG_LEVEL_WRN
default 3 if SHELL_RTT_INIT_LOG_LEVEL_INF
default 4 if SHELL_RTT_INIT_LOG_LEVEL_DBG
default 5 if SHELL_RTT_INIT_LOG_LEVEL_DEFAULT
module = SHELL_RTT
module-str = RTT shell backend
source "subsys/logging/Kconfig.template.log_config"
endif # SHELL_BACKEND_RTT
config SHELL_BACKEND_MQTT
bool "MQTT backend"
depends on NET_TCP
depends on NET_IPV4
depends on NETWORKING
select DNS_RESOLVER
select HWINFO
select MQTT_LIB
select NET_MGMT
select NET_MGMT_EVENT
help
Enable MQTT backend.
if SHELL_BACKEND_MQTT
config SHELL_MQTT_SERVER_ADDR
string "MQTT server address"
default "192.168.0.100"
help
MQTT server address.
config SHELL_MQTT_SERVER_PORT
int "MQTT server port"
default 1883
help
MQTT server port.
config SHELL_MQTT_SERVER_USERNAME
string "MQTT server username"
help
MQTT server username.
config SHELL_MQTT_SERVER_PASSWORD
string "MQTT server password"
help
MQTT server password.
config SHELL_MQTT_RX_BUF_SIZE
int "RX buffer size"
default 256
help
Buffer size for the MQTT data reception.
config SHELL_MQTT_TX_BUF_SIZE
int "TX buffer size"
range 32 65535
default 256
help
Buffer size for the MQTT data transmission.
module = SHELL_BACKEND_MQTT
default-timeout = 100
source "subsys/shell/Kconfig.template.shell_log_queue_timeout"
default-size = 10
source "subsys/shell/Kconfig.template.shell_log_queue_size"
choice
prompt "Initial log level limit"
default SHELL_MQTT_INIT_LOG_LEVEL_DEFAULT
config SHELL_MQTT_INIT_LOG_LEVEL_DEFAULT
bool "System limit (LOG_MAX_LEVEL)"
config SHELL_MQTT_INIT_LOG_LEVEL_DBG
bool "Debug"
config SHELL_MQTT_INIT_LOG_LEVEL_INF
bool "Info"
config SHELL_MQTT_INIT_LOG_LEVEL_WRN
bool "Warning"
config SHELL_MQTT_INIT_LOG_LEVEL_ERR
bool "Error"
config SHELL_MQTT_INIT_LOG_LEVEL_NONE
bool "None"
endchoice # SHELL_MQTT_INIT_LOG_LEVEL
config SHELL_MQTT_INIT_LOG_LEVEL
int
default 0 if SHELL_MQTT_INIT_LOG_LEVEL_NONE
default 1 if SHELL_MQTT_INIT_LOG_LEVEL_ERR
default 2 if SHELL_MQTT_INIT_LOG_LEVEL_WRN
default 3 if SHELL_MQTT_INIT_LOG_LEVEL_INF
default 4 if SHELL_MQTT_INIT_LOG_LEVEL_DBG
default 5 if SHELL_MQTT_INIT_LOG_LEVEL_DEFAULT
module = SHELL_MQTT
module-str = MQTT shell backend
source "subsys/logging/Kconfig.template.log_config"
endif # SHELL_BACKEND_MQTT
config SHELL_BACKEND_TELNET
bool "TELNET backend."
depends on NET_TCP
depends on NET_IPV4 || NET_IPV6
help
Enable TELNET backend.
if SHELL_BACKEND_TELNET
config SHELL_PROMPT_TELNET
string "Displayed prompt name"
default "~$ "
help
Displayed prompt name for TELNET backend.
config SHELL_TELNET_PORT
int "Telnet port number"
default 23
help
This option is used to configure on which port telnet is going
to be bound.
config SHELL_TELNET_LINE_BUF_SIZE
int "Telnet line buffer size"
default 80
help
This option can be used to modify the size of the buffer storing
shell output line, prior to sending it through the network.
Of course an output line can be longer than such size, it just
means sending it will start as soon as it reaches this size.
It really depends on what type of output is expected.
A lot of short lines: better reduce this value. On the contrary,
raise it.
config SHELL_TELNET_SEND_TIMEOUT
int "Telnet line send timeout"
default 100
help
This option can be used to modify the duration of the timer that kick
in when a line buffer is not empty but did not yet meet the line feed.
config SHELL_TELNET_SUPPORT_COMMAND
bool "Add support for telnet commands (IAC) [EXPERIMENTAL]"
select EXPERIMENTAL
help
Current support is so limited it's not interesting to enable it.
However, if proven to be needed at some point, it will be possible
to extend such support.
module = SHELL_TELNET
default-timeout = 100
source "subsys/shell/Kconfig.template.shell_log_queue_timeout"
default-size = 10
source "subsys/shell/Kconfig.template.shell_log_queue_size"
choice
prompt "Initial log level limit"
default SHELL_TELNET_INIT_LOG_LEVEL_DEFAULT
config SHELL_TELNET_INIT_LOG_LEVEL_DEFAULT
bool "System limit (LOG_MAX_LEVEL)"
config SHELL_TELNET_INIT_LOG_LEVEL_DBG
bool "Debug"
config SHELL_TELNET_INIT_LOG_LEVEL_INF
bool "Info"
config SHELL_TELNET_INIT_LOG_LEVEL_WRN
bool "Warning"
config SHELL_TELNET_INIT_LOG_LEVEL_ERR
bool "Error"
config SHELL_TELNET_INIT_LOG_LEVEL_NONE
bool "None"
endchoice
config SHELL_TELNET_INIT_LOG_LEVEL
int
default 0 if SHELL_TELNET_INIT_LOG_LEVEL_NONE
default 1 if SHELL_TELNET_INIT_LOG_LEVEL_ERR
default 2 if SHELL_TELNET_INIT_LOG_LEVEL_WRN
default 3 if SHELL_TELNET_INIT_LOG_LEVEL_INF
default 4 if SHELL_TELNET_INIT_LOG_LEVEL_DBG
default 5 if SHELL_TELNET_INIT_LOG_LEVEL_DEFAULT
module = SHELL_TELNET
module-str = TELNET shell backend
source "subsys/logging/Kconfig.template.log_config"
endif # SHELL_TELNET_BACKEND
config SHELL_BACKEND_DUMMY
bool "Dummy backend."
help
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"
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