2019-11-01 20:45:29 +08:00
|
|
|
# mcumgr configuration options
|
2018-01-18 10:02:30 +08:00
|
|
|
|
|
|
|
# Copyright Runtime.io 2018. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
menu "Management"
|
|
|
|
|
|
|
|
config MCUMGR_SMP_BT
|
2018-07-12 19:26:29 +08:00
|
|
|
bool "Bluetooth mcumgr SMP transport"
|
2018-01-18 10:02:30 +08:00
|
|
|
select MCUMGR
|
|
|
|
select BT
|
|
|
|
select BT_PERIPHERAL
|
2019-04-25 16:23:14 +08:00
|
|
|
select BT_GATT_DYNAMIC_DB
|
2018-01-18 10:02:30 +08:00
|
|
|
help
|
|
|
|
Enables handling of SMP commands received over Bluetooth.
|
|
|
|
|
2019-11-07 20:34:14 +08:00
|
|
|
config MCUMGR_SMP_BT_AUTHEN
|
|
|
|
bool "Authenticated requirement for Bluetooth mcumgr SMP transport"
|
|
|
|
depends on MCUMGR_SMP_BT
|
|
|
|
select BT_SMP
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Enables encrypted and authenticated connection requirement to
|
|
|
|
Bluetooth SMP transport.
|
|
|
|
|
2018-01-18 10:02:30 +08:00
|
|
|
config MCUMGR_SMP_SHELL
|
2018-07-12 19:26:29 +08:00
|
|
|
bool "Shell mcumgr SMP transport"
|
2018-01-18 10:02:30 +08:00
|
|
|
select MCUMGR
|
2019-01-10 20:13:09 +08:00
|
|
|
select SHELL
|
|
|
|
select SHELL_BACKEND_SERIAL
|
2018-03-23 03:43:04 +08:00
|
|
|
select BASE64
|
2018-01-18 10:02:30 +08:00
|
|
|
help
|
|
|
|
Enables handling of SMP commands received over shell. This allows
|
|
|
|
the shell to be use for both mcumgr commands and shell commands.
|
|
|
|
|
|
|
|
config MCUMGR_SMP_SHELL_MTU
|
2018-07-12 19:26:29 +08:00
|
|
|
int "Shell SMP MTU"
|
2018-01-18 10:02:30 +08:00
|
|
|
default 256
|
kconfig: Replace some single-symbol 'if's with 'depends on'
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.
There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.
The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).
Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.
Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.
Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.
The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.
(Everything above is true for choices, menus, and comments as well.)
Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 10:45:50 +08:00
|
|
|
depends on MCUMGR_SMP_SHELL
|
2018-01-18 10:02:30 +08:00
|
|
|
help
|
|
|
|
Maximum size of SMP frames sent and received over shell. This value
|
|
|
|
must satisfy the following relation:
|
|
|
|
MCUMGR_SMP_SHELL_MTU <= MCUMGR_BUF_SIZE + 2
|
|
|
|
|
|
|
|
config MCUMGR_SMP_UART
|
2018-07-12 19:26:29 +08:00
|
|
|
bool "UART mcumgr SMP transport"
|
2018-01-18 10:02:30 +08:00
|
|
|
select MCUMGR
|
|
|
|
select UART_MCUMGR
|
2018-03-23 03:43:04 +08:00
|
|
|
select BASE64
|
2018-01-18 10:02:30 +08:00
|
|
|
help
|
|
|
|
Enables handling of SMP commands received over UART. This is a
|
|
|
|
lightweight alternative to MCUMGR_SMP_SHELL. It allows mcumgr
|
|
|
|
commands to be received over UART without requiring an additional
|
|
|
|
thread.
|
|
|
|
|
|
|
|
config MCUMGR_SMP_UART_MTU
|
2018-07-12 19:26:29 +08:00
|
|
|
int "UART SMP MTU"
|
2018-01-18 10:02:30 +08:00
|
|
|
default 256
|
kconfig: Replace some single-symbol 'if's with 'depends on'
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.
There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.
The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).
Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.
Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.
Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.
The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.
(Everything above is true for choices, menus, and comments as well.)
Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 10:45:50 +08:00
|
|
|
depends on MCUMGR_SMP_UART
|
2018-01-18 10:02:30 +08:00
|
|
|
help
|
|
|
|
Maximum size of SMP frames sent and received over UART, in bytes.
|
|
|
|
This value must satisfy the following relation:
|
|
|
|
MCUMGR_SMP_UART_MTU <= MCUMGR_BUF_SIZE + 2
|
|
|
|
|
2019-05-28 20:11:23 +08:00
|
|
|
source "subsys/mgmt/Kconfig.mcumgr"
|
|
|
|
|
2019-06-03 23:10:19 +08:00
|
|
|
config MCUMGR_SMP_UDP
|
|
|
|
bool "UDP mcumgr SMP transport"
|
|
|
|
select MCUMGR
|
|
|
|
select NETWORKING
|
|
|
|
select NET_UDP
|
|
|
|
select NET_SOCKETS
|
|
|
|
select NET_SOCKETS_POSIX_NAMES
|
|
|
|
help
|
|
|
|
Enables handling of SMP commands received over UDP.
|
|
|
|
Will start a thread for listening on the configured UDP port.
|
|
|
|
|
|
|
|
config MCUMGR_SMP_UDP_IPV4
|
|
|
|
bool "UDP SMP using IPv4"
|
|
|
|
depends on MCUMGR_SMP_UDP
|
|
|
|
depends on NET_IPV4
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Enable SMP UDP using IPv4 addressing.
|
|
|
|
Can be enabled alongside IPv6 addressing.
|
|
|
|
|
|
|
|
config MCUMGR_SMP_UDP_IPV6
|
|
|
|
bool "UDP SMP using IPv6"
|
|
|
|
depends on MCUMGR_SMP_UDP
|
|
|
|
depends on NET_IPV6
|
|
|
|
help
|
|
|
|
Enable SMP UDP using IPv6 addressing.
|
|
|
|
Can be enabled alongside IPv4 addressing.
|
|
|
|
|
|
|
|
config MCUMGR_SMP_UDP_PORT
|
|
|
|
int "UDP SMP port"
|
|
|
|
depends on MCUMGR_SMP_UDP
|
|
|
|
default 1337
|
|
|
|
help
|
|
|
|
UDP port that SMP server will listen for SMP commands on.
|
|
|
|
|
|
|
|
config MCUMGR_SMP_UDP_STACK_SIZE
|
|
|
|
int "UDP SMP stack size"
|
|
|
|
depends on MCUMGR_SMP_UDP
|
|
|
|
default 512
|
|
|
|
help
|
|
|
|
Stack size of the SMP UDP listening thread
|
|
|
|
|
|
|
|
config MCUMGR_SMP_UDP_THREAD_PRIO
|
|
|
|
int "UDP SMP thread priority"
|
|
|
|
depends on MCUMGR_SMP_UDP
|
|
|
|
default 0
|
|
|
|
help
|
|
|
|
Scheduling priority of the SMP UDP listening thread.
|
|
|
|
|
|
|
|
config MCUMGR_SMP_UDP_MTU
|
|
|
|
int "UDP SMP MTU"
|
|
|
|
depends on MCUMGR_SMP_UDP
|
|
|
|
default 1500
|
|
|
|
help
|
|
|
|
Maximum size of SMP frames sent and received over UDP, in bytes.
|
|
|
|
This value must satisfy the following relation:
|
|
|
|
MCUMGR_SMP_UDP_MTU <= MCUMGR_BUF_SIZE + SMP msg overhead - address size
|
|
|
|
where address size is determined by IPv4/IPv6 selection.
|
|
|
|
|
2018-10-19 21:16:49 +08:00
|
|
|
if MCUMGR
|
2018-01-18 10:02:30 +08:00
|
|
|
config MCUMGR_BUF_COUNT
|
2018-07-12 19:26:29 +08:00
|
|
|
int "Number of mcumgr buffers"
|
2019-06-03 23:10:19 +08:00
|
|
|
default 2 if MCUMGR_SMP_UDP
|
2018-01-18 10:02:30 +08:00
|
|
|
default 4
|
|
|
|
help
|
|
|
|
The number of net_bufs to allocate for mcumgr. These buffers are
|
|
|
|
used for both requests and responses.
|
|
|
|
|
|
|
|
config MCUMGR_BUF_SIZE
|
2018-07-12 19:26:29 +08:00
|
|
|
int "Size of each mcumgr buffer"
|
2019-06-03 23:10:19 +08:00
|
|
|
default 2048 if MCUMGR_SMP_UDP
|
2018-01-18 10:02:30 +08:00
|
|
|
default 384
|
|
|
|
help
|
|
|
|
The size, in bytes, of each mcumgr buffer. This value must satisfy
|
|
|
|
the following relation:
|
|
|
|
MCUMGR_BUF_SIZE >= transport-specific-MTU + transport-overhead
|
|
|
|
|
|
|
|
config MCUMGR_BUF_USER_DATA_SIZE
|
2018-07-12 19:26:29 +08:00
|
|
|
int "Size of mcumgr buffer user data"
|
2019-06-03 23:10:19 +08:00
|
|
|
default 24 if MCUMGR_SMP_UDP && MCUMGR_SMP_UDP_IPV6
|
|
|
|
default 8 if MCUMGR_SMP_UDP && MCUMGR_SMP_UDP_IPV4
|
2018-06-06 22:28:01 +08:00
|
|
|
default 4
|
2018-01-18 10:02:30 +08:00
|
|
|
help
|
|
|
|
The size, in bytes, of user data to allocate for each mcumgr buffer.
|
2019-06-03 23:10:19 +08:00
|
|
|
|
2018-01-18 10:02:30 +08:00
|
|
|
Different mcumgr transports impose different requirements for this
|
2019-06-03 23:10:19 +08:00
|
|
|
setting. A value of 4 is sufficient for UART, shell, and bluetooth.
|
|
|
|
For UDP, the userdata must be large enough to hold a IPv4/IPv6 address.
|
|
|
|
|
|
|
|
Note that CONFIG_NET_BUF_USER_DATA_SIZE must be at least as big as
|
|
|
|
MCUMGR_BUF_USER_DATA_SIZE.
|
2018-01-18 10:02:30 +08:00
|
|
|
|
2018-10-19 21:16:49 +08:00
|
|
|
endif # MCUMGR
|
2018-01-18 10:02:30 +08:00
|
|
|
endmenu
|