Skip to content

Commit c7378d0

Browse files
de-nordiccarlescufi
authored andcommitted
mgmt/mcumgr: Move Kconfig options to proper Kconfig files
After Kconfig options got renamed, some of the no longer fit to files they have been defined in. Signed-off-by: Dominik Ermel <[email protected]>
1 parent d492c0d commit c7378d0

File tree

4 files changed

+115
-111
lines changed

4 files changed

+115
-111
lines changed

subsys/mgmt/mcumgr/Kconfig

Lines changed: 1 addition & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -16,107 +16,9 @@ module = MCUMGR
1616
module-str = mcumgr
1717
source "subsys/logging/Kconfig.template.log_config"
1818

19-
config MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE
20-
int "MCUmgr transport workqueue stack size"
21-
default 2048
22-
help
23-
Stack size of the MCUmgr for transport subsystem work queue.
24-
25-
config MCUMGR_TRANSPORT_WORKQUEUE_THREAD_PRIO
26-
int "MCUmgr transport workqueue thread priority"
27-
default 3
28-
help
29-
Scheduling priority of the MCUmgr transport subsystem work queue.
30-
3119
rsource "mgmt/Kconfig"
3220

33-
config MCUMGR_SMP_CBOR_MAX_MAIN_MAP_ENTRIES
34-
int "Number of predicted maximum entries to main response map"
35-
default 15
36-
help
37-
This is number of predicted entries in main response map,
38-
the one that encapsulates everything within response.
39-
This value is used by zcbor to predict needed map encoding,
40-
and does not affect memory allocation or usage.
41-
Builtin command processors rarely add large amounts of
42-
data directly to main map, creating sub-maps instead so
43-
the default value works fine with them.
44-
If your app directly adds fields to main map, without
45-
encapsulating them, you may want to increase this value
46-
in case when encoding starts to fail.
47-
48-
config MCUMGR_SMP_CBOR_MIN_DECODING_LEVELS
49-
int
50-
help
51-
Minimal decoding levels, map/list encapsulation, required
52-
to be supported by zcbor decoding of SMP responses
53-
is auto genereated from MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_? options.
54-
A group or command that adds additional maps/lists above the
55-
base map, which is already taken into account, should
56-
select one of the MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_?.
57-
default 5 if MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_5
58-
default 4 if MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_4
59-
default 3 if MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_3
60-
default 2 if MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_2
61-
default 1 if MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_1
62-
default 0
63-
64-
65-
config MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_1
66-
bool
67-
68-
config MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_2
69-
bool
70-
71-
config MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_3
72-
bool
73-
74-
config MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_4
75-
bool
76-
77-
config MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_5
78-
bool
79-
80-
config MCUMGR_SMP_CBOR_MAX_DECODING_LEVELS
81-
int "Number of map/list encapsulations allowed by SMP encoding"
82-
range MCUMGR_SMP_CBOR_MIN_DECODING_LEVELS 15
83-
default MCUMGR_SMP_CBOR_MIN_DECODING_LEVELS
84-
help
85-
This is a maximum number of levels of maps/lists that will
86-
be expected to be decoded within different command groups.
87-
SMP commands/groups that provide no CBOR encoded payload
88-
have no requirements.
89-
Commands that provide CBOR payload require at least 1 level,
90-
and additional levels for each map/list encapsulation.
91-
For example if command accepts payload of map of parameters
92-
it will need 2 levels.
93-
This number translates to zcbor backup states, it increases
94-
size of cbor_nb_reader structure by zcbor_state_t size per
95-
one unit selected here.
96-
97-
config MCUMGR_MGMT_NOTIFICATION_HOOKS
98-
bool "MCUmgr notification hook support"
99-
help
100-
With this enabled, applications and parts of code can register for MCUmgr event
101-
notifications which will result in callbacks when a registered event occurs. Note that
102-
this enables the base notification functionality but itself does not enable any
103-
notifications, which must be enabled by selecting other Kconfig options.
104-
105-
To enable notifications in code, mgmt_callback_register() must be called with the
106-
callback function and events that want to be received. Multiple handlers can be
107-
registered and will all be called when registered events occur.
108-
109-
Some callbacks support notifying the calling function of a status, in which to accept
110-
or decline the current operation, by returning false this will signal to the calling
111-
function that the request should be denied, for informal-only notifications or
112-
acceptable, true must be returned by all the registered notification handlers.
113-
114-
config MCUMGR_SMP_COMMAND_STATUS_HOOKS
115-
bool "SMP command status hooks"
116-
depends on MCUMGR_MGMT_NOTIFICATION_HOOKS
117-
help
118-
This will enable SMP command status notification hooks for when an SMP message is
119-
received or processed.
21+
rsource "smp/Kconfig"
12022

12123
config MCUMGR_SMP_LEGACY_RC_BEHAVIOUR
12224
bool "Legacy rc (result code) response behaviour"
@@ -142,8 +44,4 @@ rsource "transport/Kconfig"
14244

14345
endmenu
14446

145-
module = MCUMGR_TRANSPORT
146-
module-str = mcumgr_transport
147-
source "subsys/logging/Kconfig.template.log_config"
148-
14947
endif # MCUMGR

subsys/mgmt/mcumgr/mgmt/Kconfig

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22
# Copyright Nordic Semiconductor ASA 2020-2022. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44

5-
config MCUMGR_SMP_VERBOSE_ERR_RESPONSE
6-
bool "Support verbose error response"
5+
config MCUMGR_MGMT_NOTIFICATION_HOOKS
6+
bool "MCUmgr notification hook support"
77
help
8-
Support for encoding "rc" code explanation in form of "rsn"
9-
text string. This is useful, when returning MGMT_ERR_EUNKNOWN,
10-
to add additional information on the source of an error.
11-
Note that the "rsn" is string additional to "rc" code,
12-
so MCUMGR_TRANSPORT_NETBUF_SIZE should be large enough to be able
13-
to encode both.
8+
With this enabled, applications and parts of code can register for MCUmgr event
9+
notifications which will result in callbacks when a registered event occurs. Note that
10+
this enables the base notification functionality but itself does not enable any
11+
notifications, which must be enabled by selecting other Kconfig options.
12+
13+
To enable notifications in code, mgmt_callback_register() must be called with the
14+
callback function and events that want to be received. Multiple handlers can be
15+
registered and will all be called when registered events occur.
16+
17+
Some callbacks support notifying the calling function of a status, in which to accept
18+
or decline the current operation, by returning false this will signal to the calling
19+
function that the request should be denied, for informal-only notifications or
20+
acceptable, true must be returned by all the registered notification handlers.

subsys/mgmt/mcumgr/smp/Kconfig

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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+
config MCUMGR_SMP_CBOR_MAX_MAIN_MAP_ENTRIES
6+
int "Number of predicted maximum entries to main response map"
7+
default 15
8+
help
9+
This is number of predicted entries in main response map,
10+
the one that encapsulates everything within response.
11+
This value is used by zcbor to predict needed map encoding,
12+
and does not affect memory allocation or usage.
13+
Builtin command processors rarely add large amounts of
14+
data directly to main map, creating sub-maps instead so
15+
the default value works fine with them.
16+
If your app directly adds fields to main map, without
17+
encapsulating them, you may want to increase this value
18+
in case when encoding starts to fail.
19+
20+
config MCUMGR_SMP_CBOR_MIN_DECODING_LEVELS
21+
int
22+
help
23+
Minimal decoding levels, map/list encapsulation, required
24+
to be supported by zcbor decoding of SMP responses
25+
is auto genereated from MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_? options.
26+
A group or command that adds additional maps/lists above the
27+
base map, which is already taken into account, should
28+
select one of the MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_?.
29+
default 5 if MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_5
30+
default 4 if MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_4
31+
default 3 if MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_3
32+
default 2 if MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_2
33+
default 1 if MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_1
34+
default 0
35+
36+
config MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_1
37+
bool
38+
39+
config MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_2
40+
bool
41+
42+
config MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_3
43+
bool
44+
45+
config MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_4
46+
bool
47+
48+
config MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_5
49+
bool
50+
51+
config MCUMGR_SMP_CBOR_MAX_DECODING_LEVELS
52+
int "Number of map/list encapsulations allowed by SMP encoding"
53+
range MCUMGR_SMP_CBOR_MIN_DECODING_LEVELS 15
54+
default MCUMGR_SMP_CBOR_MIN_DECODING_LEVELS
55+
help
56+
This is a maximum number of levels of maps/lists that will
57+
be expected to be decoded within different command groups.
58+
SMP commands/groups that provide no CBOR encoded payload
59+
have no requirements.
60+
Commands that provide CBOR payload require at least 1 level,
61+
and additional levels for each map/list encapsulation.
62+
For example if command accepts payload of map of parameters
63+
it will need 2 levels.
64+
This number translates to zcbor backup states, it increases
65+
size of cbor_nb_reader structure by zcbor_state_t size per
66+
one unit selected here.
67+
68+
config MCUMGR_SMP_COMMAND_STATUS_HOOKS
69+
bool "SMP command status hooks"
70+
depends on MCUMGR_MGMT_NOTIFICATION_HOOKS
71+
help
72+
This will enable SMP command status notification hooks for when an SMP message is
73+
received or processed.
74+
75+
config MCUMGR_SMP_VERBOSE_ERR_RESPONSE
76+
bool "Support verbose error response"
77+
help
78+
Support for encoding "rc" code explanation in form of "rsn"
79+
text string. This is useful, when returning MGMT_ERR_EUNKNOWN,
80+
to add additional information on the source of an error.
81+
Note that the "rsn" is string additional to "rc" code,
82+
so MCUMGR_TRANSPORT_NETBUF_SIZE should be large enough to be able
83+
to encode both.

subsys/mgmt/mcumgr/transport/Kconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
# Copyright Nordic Semiconductor ASA 2020-2022. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44

5+
config MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE
6+
int "MCUmgr transport workqueue stack size"
7+
default 2048
8+
help
9+
Stack size of the MCUmgr for transport subsystem work queue.
10+
11+
config MCUMGR_TRANSPORT_WORKQUEUE_THREAD_PRIO
12+
int "MCUmgr transport workqueue thread priority"
13+
default 3
14+
help
15+
Scheduling priority of the MCUmgr transport subsystem work queue.
16+
517
config MCUMGR_TRANSPORT_REASSEMBLY
618
bool
719
help
@@ -40,6 +52,10 @@ config MCUMGR_TRANSPORT_NETBUF_USER_DATA_SIZE
4052
is sufficient for Bluetooth. For UDP, the userdata must be large
4153
enough to hold a IPv4/IPv6 address.
4254

55+
module = MCUMGR_TRANSPORT
56+
module-str = mcumgr_transport
57+
source "subsys/logging/Kconfig.template.log_config"
58+
4359
rsource "Kconfig.dummy"
4460

4561
rsource "Kconfig.bluetooth"

0 commit comments

Comments
 (0)