Skip to content

Commit 398487f

Browse files
sjancdleach02
authored andcommitted
Bluetooth: GATT: Convert writable device name to KConfig choice
This makes it clear on how security requirements are set and avoid confusion on how encryption and authentication are handled. Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
1 parent a501050 commit 398487f

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

subsys/bluetooth/host/Kconfig.gatt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -260,28 +260,31 @@ config BT_PERIPHERAL_PREF_TIMEOUT
260260
endif # BT_GAP_PERIPHERAL_PREF_PARAMS
261261

262262
config BT_DEVICE_NAME_GATT_WRITABLE
263-
bool "Allow to write name by remote GATT clients"
263+
bool "Allow to write device name by remote GATT clients"
264264
depends on BT_DEVICE_NAME_DYNAMIC
265265
default y
266266
help
267267
Enabling this option allows remote GATT clients to write to device
268268
name GAP characteristic.
269269

270270
if BT_DEVICE_NAME_GATT_WRITABLE
271-
config DEVICE_NAME_GATT_WRITABLE_ENCRYPT
272-
bool "Encryption required to write name by remote GATT clients"
273-
default y
271+
choice BT_DEVICE_NAME_GATT_WRITABLE_SECURITY
272+
prompt "Security requirements"
273+
default DEVICE_NAME_GATT_WRITABLE_ENCRYPT
274274
help
275-
Enabling this option requires the connection to be encrypted to write
276-
to the device name GAP characteristic.
275+
Select security requirementsf for writing device name by remote GATT
276+
clients.
277277

278+
config DEVICE_NAME_GATT_WRITABLE_NONE
279+
bool "No requirements"
280+
281+
config DEVICE_NAME_GATT_WRITABLE_ENCRYPT
282+
bool "Encryption required"
278283

279284
config DEVICE_NAME_GATT_WRITABLE_AUTHEN
280-
bool "Authentication required to write name by remote GATT clients"
281-
help
282-
Enabling this option requires the connection to be encrypted and
283-
authenticated to write to the device name GAP characteristic.
285+
bool "Encryption and authentication required"
284286

287+
endchoice #BT_DEVICE_NAME_GATT_WRITABLE_SECURITY
285288
endif #BT_DEVICE_NAME_GATT_WRITABLE
286289

287290
config BT_GATT_AUTHORIZATION_CUSTOM

0 commit comments

Comments
 (0)