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 Bluetooth transport of MCUmgr
6# subsystem and provides Kconfig options to control aspects of
7# the transport.
8#
9# Options defined in this file should be prefixed:
10#  MCUMGR_TRANSPORT_BT_
11
12menuconfig MCUMGR_TRANSPORT_BT
13	bool "Bluetooth mcumgr SMP transport"
14	depends on BT_PERIPHERAL
15	help
16	  Enables handling of SMP commands received over Bluetooth.
17
18if MCUMGR_TRANSPORT_BT
19
20config MCUMGR_TRANSPORT_BT_REASSEMBLY
21	bool "Reassemble packets in Bluetooth SMP transport"
22	select MCUMGR_TRANSPORT_REASSEMBLY
23	help
24	  When enabled, the SMP BT transport will buffer and reassemble received
25	  packet fragments before passing it for further processing.
26
27choice MCUMGR_TRANSPORT_BT_PERM
28	prompt "Permission used for the SMP service"
29	default MCUMGR_TRANSPORT_BT_PERM_RW_AUTHEN if BT_SMP
30	default MCUMGR_TRANSPORT_BT_PERM_RW
31	help
32	  Permission settings for GATT characteristics of the SMP service.
33
34config MCUMGR_TRANSPORT_BT_PERM_RW
35	bool "Read and write allowed"
36
37config MCUMGR_TRANSPORT_BT_PERM_RW_ENCRYPT
38	bool "Require encryption for access"
39	depends on BT_SMP
40
41config MCUMGR_TRANSPORT_BT_PERM_RW_AUTHEN
42	bool "Require encryption and authentication for access"
43	depends on BT_SMP
44
45endchoice
46
47config MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL
48	bool "Request specific connection parameters for SMP packet exchange"
49	depends on SYSTEM_WORKQUEUE_PRIORITY < 0
50	depends on BT_GAP_PERIPHERAL_PREF_PARAMS
51	help
52	  Enables support for requesting specific connection parameters when
53	  SMP commands are handled. This option allows to speed up the command
54	  exchange process.
55	  Its recommended to enable this if SMP is used for DFU.
56
57if MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL
58
59config MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL_MIN_INT
60	int "Minimum connection interval for SMP packet exchange"
61	default 6
62	range 6 3200
63	help
64	  Minimum connection interval in 1.25ms units used during the exchange of SMP packets.
65
66config MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL_MAX_INT
67	int "Maximum connection interval for SMP packet exchange"
68	default 9
69	range MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL_MIN_INT 3200
70	help
71	  Maximum connection interval in 1.25ms units used during the exchange of SMP packets.
72
73config MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL_LATENCY
74	int "Peripheral latency for SMP packet exchange"
75	default 0
76	range 0 499
77	help
78	  Peripheral latency in Connection Intervals used during the exchange of SMP packets.
79
80config MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL_TIMEOUT
81	int "Supervision timeout for SMP packet exchange"
82	default 42
83	range 10 3200
84	help
85	  Supervision timeout in 10ms used during the exchange of SMP packets.
86
87config MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL_RESTORE_TIME
88	int "Connection parameters restore time in milliseconds"
89	default 5000
90	range 1000 $(UINT16_MAX)
91	help
92	  The value is a time of inactivity on the SMP characteristic after which
93	  connection parameters are restored to peripheral preferred values
94	  (BT_GAP_PERIPHERAL_PREF_PARAMS).
95
96config MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL_RETRY_TIME
97	int "Connection parameters update retry time in milliseconds"
98	default 1000
99	range 1 5000
100	help
101	  In case connection parameters update fails due to an error, this
102	  option specifies the time of the next update attempt.
103
104endif # MCUMGR_TRASNPORT_BT_CONN_PARAM_CONTROL
105
106config MCUMGR_TRANSPORT_BT_DYNAMIC_SVC_REGISTRATION
107	bool "Register SMP service at runtime"
108	depends on BT_GATT_DYNAMIC_DB
109	default y
110	help
111	  When enabled, the SMP service will be automatically registered at boot time
112	  and can then be dynamically registered/unregistered using a dedicated API.
113	  Otherwise, the SMP service will be statically defined and registered.
114
115endif # MCUMGR_TRANSPORT_BT
116