From 92e0d0bbfc76ba41c3844b7362bcccf488895087 Mon Sep 17 00:00:00 2001 From: Luis Ubieda Date: Mon, 25 Mar 2024 16:08:36 -0400 Subject: [PATCH] bluetooth: nus: Change Kconfigs prefix to BT_ZEPHYR_NUS To prevent future conflicts with NCS's NUS implementation, whose Kconfig's are prefixed with BT_NUS. Signed-off-by: Luis Ubieda --- doc/releases/release-notes-3.7.rst | 4 ++-- drivers/serial/Kconfig.bt | 2 +- include/zephyr/linker/common-ram.ld | 2 +- samples/bluetooth/peripheral_nus/prj.conf | 2 +- samples/subsys/logging/logger/overlay-bt.conf | 4 ++-- samples/subsys/shell/shell_module/overlay-bt.conf | 4 ++-- snippets/nus-console/README.rst | 2 +- snippets/nus-console/nus-console.conf | 4 ++-- subsys/bluetooth/services/CMakeLists.txt | 2 +- subsys/bluetooth/services/nus/CMakeLists.txt | 2 +- subsys/bluetooth/services/nus/Kconfig.nus | 10 +++++----- subsys/bluetooth/services/nus/nus.c | 4 ++-- subsys/bluetooth/services/nus/nus_inst.c | 2 +- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/doc/releases/release-notes-3.7.rst b/doc/releases/release-notes-3.7.rst index 6b454318a0b..2e046f084b1 100644 --- a/doc/releases/release-notes-3.7.rst +++ b/doc/releases/release-notes-3.7.rst @@ -37,7 +37,7 @@ Architectures Bluetooth ********* - * Added Nordic UART Service (NUS), enabled by the :kconfig:option:`CONFIG_BT_NUS`. + * Added Nordic UART Service (NUS), enabled by the :kconfig:option:`CONFIG_BT_ZEPHYR_NUS`. This Service exposes the ability to declare multiple instances of the GATT service, allowing multiple serial endpoints to be used for different purposes. @@ -257,6 +257,6 @@ Tests and Samples ***************** * Added snippet for easily enabling UART over Bluetooth LE by passing ``-S nus-console`` during - ``west build``. This snippet sets the :kconfig:option:`CONFIG_BT_NUS_AUTO_START_BLUETOOTH` + ``west build``. This snippet sets the :kconfig:option:`CONFIG_BT_ZEPHYR_NUS_AUTO_START_BLUETOOTH` which allows non-Bluetooth samples that use the UART APIs to run without modifications (e.g: Console and Logging examples). diff --git a/drivers/serial/Kconfig.bt b/drivers/serial/Kconfig.bt index a650615f219..500613d6208 100644 --- a/drivers/serial/Kconfig.bt +++ b/drivers/serial/Kconfig.bt @@ -3,7 +3,7 @@ config UART_BT bool "UART over NUS Bluetooth LE" - depends on BT_NUS + depends on BT_ZEPHYR_NUS depends on DT_HAS_ZEPHYR_NUS_UART_ENABLED select UART_INTERRUPT_DRIVEN select RING_BUFFER diff --git a/include/zephyr/linker/common-ram.ld b/include/zephyr/linker/common-ram.ld index 847c8373548..538b3465b01 100644 --- a/include/zephyr/linker/common-ram.ld +++ b/include/zephyr/linker/common-ram.ld @@ -140,7 +140,7 @@ ITERABLE_SECTION_RAM(device_mutable, 4) #endif -#if defined(CONFIG_BT_NUS) +#if defined(CONFIG_BT_ZEPHYR_NUS) ITERABLE_SECTION_RAM(bt_nus_inst, 4) #endif diff --git a/samples/bluetooth/peripheral_nus/prj.conf b/samples/bluetooth/peripheral_nus/prj.conf index 8eafb75f19c..0db8cecc209 100644 --- a/samples/bluetooth/peripheral_nus/prj.conf +++ b/samples/bluetooth/peripheral_nus/prj.conf @@ -1,3 +1,3 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y -CONFIG_BT_NUS=y +CONFIG_BT_ZEPHYR_NUS=y diff --git a/samples/subsys/logging/logger/overlay-bt.conf b/samples/subsys/logging/logger/overlay-bt.conf index bae817ce562..6691d1c36e7 100644 --- a/samples/subsys/logging/logger/overlay-bt.conf +++ b/samples/subsys/logging/logger/overlay-bt.conf @@ -4,9 +4,9 @@ CONFIG_UART_CONSOLE=y CONFIG_BT=y CONFIG_BT_PERIPHERAL=y -CONFIG_BT_NUS=y +CONFIG_BT_ZEPHYR_NUS=y CONFIG_UART_BT=y -CONFIG_BT_NUS_AUTO_START_BLUETOOTH=y +CONFIG_BT_ZEPHYR_NUS_AUTO_START_BLUETOOTH=y # Bluetooth optimizations to allow larger data packets. CONFIG_BT_RX_STACK_SIZE=2048 diff --git a/samples/subsys/shell/shell_module/overlay-bt.conf b/samples/subsys/shell/shell_module/overlay-bt.conf index bae817ce562..6691d1c36e7 100644 --- a/samples/subsys/shell/shell_module/overlay-bt.conf +++ b/samples/subsys/shell/shell_module/overlay-bt.conf @@ -4,9 +4,9 @@ CONFIG_UART_CONSOLE=y CONFIG_BT=y CONFIG_BT_PERIPHERAL=y -CONFIG_BT_NUS=y +CONFIG_BT_ZEPHYR_NUS=y CONFIG_UART_BT=y -CONFIG_BT_NUS_AUTO_START_BLUETOOTH=y +CONFIG_BT_ZEPHYR_NUS_AUTO_START_BLUETOOTH=y # Bluetooth optimizations to allow larger data packets. CONFIG_BT_RX_STACK_SIZE=2048 diff --git a/snippets/nus-console/README.rst b/snippets/nus-console/README.rst index 5d84343094b..10962681151 100644 --- a/snippets/nus-console/README.rst +++ b/snippets/nus-console/README.rst @@ -20,7 +20,7 @@ Hardware support for: - :kconfig:option:`CONFIG_BT` - :kconfig:option:`CONFIG_BT_PERIPHERAL` -- :kconfig:option:`CONFIG_BT_NUS` +- :kconfig:option:`CONFIG_BT_ZEPHYR_NUS` - :kconfig:option:`CONFIG_SERIAL` - :kconfig:option:`CONFIG_CONSOLE` - :kconfig:option:`CONFIG_UART_CONSOLE` diff --git a/snippets/nus-console/nus-console.conf b/snippets/nus-console/nus-console.conf index bae817ce562..6691d1c36e7 100644 --- a/snippets/nus-console/nus-console.conf +++ b/snippets/nus-console/nus-console.conf @@ -4,9 +4,9 @@ CONFIG_UART_CONSOLE=y CONFIG_BT=y CONFIG_BT_PERIPHERAL=y -CONFIG_BT_NUS=y +CONFIG_BT_ZEPHYR_NUS=y CONFIG_UART_BT=y -CONFIG_BT_NUS_AUTO_START_BLUETOOTH=y +CONFIG_BT_ZEPHYR_NUS_AUTO_START_BLUETOOTH=y # Bluetooth optimizations to allow larger data packets. CONFIG_BT_RX_STACK_SIZE=2048 diff --git a/subsys/bluetooth/services/CMakeLists.txt b/subsys/bluetooth/services/CMakeLists.txt index bb219891f0f..0955f202dae 100644 --- a/subsys/bluetooth/services/CMakeLists.txt +++ b/subsys/bluetooth/services/CMakeLists.txt @@ -17,6 +17,6 @@ if(CONFIG_BT_IAS OR CONFIG_BT_IAS_CLIENT) add_subdirectory(ias) endif() -if(CONFIG_BT_NUS) +if(CONFIG_BT_ZEPHYR_NUS) add_subdirectory(nus) endif() diff --git a/subsys/bluetooth/services/nus/CMakeLists.txt b/subsys/bluetooth/services/nus/CMakeLists.txt index a15271cba3c..347456d1831 100644 --- a/subsys/bluetooth/services/nus/CMakeLists.txt +++ b/subsys/bluetooth/services/nus/CMakeLists.txt @@ -9,6 +9,6 @@ zephyr_library_sources( nus_inst.c ) -zephyr_library_sources_ifdef(CONFIG_BT_NUS_AUTO_START_BLUETOOTH +zephyr_library_sources_ifdef(CONFIG_BT_ZEPHYR_NUS_AUTO_START_BLUETOOTH bt_nus_auto_start_bt.c ) diff --git a/subsys/bluetooth/services/nus/Kconfig.nus b/subsys/bluetooth/services/nus/Kconfig.nus index 1841226d7c7..9091dd91d88 100644 --- a/subsys/bluetooth/services/nus/Kconfig.nus +++ b/subsys/bluetooth/services/nus/Kconfig.nus @@ -1,12 +1,12 @@ # Copyright (c) 2024 Croxel, Inc. # SPDX-License-Identifier: Apache-2.0 -menuconfig BT_NUS +menuconfig BT_ZEPHYR_NUS bool "GATT Nordic UART Service" -if BT_NUS +if BT_ZEPHYR_NUS -config BT_NUS_DEFAULT_INSTANCE +config BT_ZEPHYR_NUS_DEFAULT_INSTANCE bool "Use default NUS Service instance" default y if !UART_BT help @@ -16,11 +16,11 @@ config BT_NUS_DEFAULT_INSTANCE BT_NUS_INST_DEFINE(), it may not be beneficial having an internal instance as well. -config BT_NUS_AUTO_START_BLUETOOTH +config BT_ZEPHYR_NUS_AUTO_START_BLUETOOTH bool "Auto-enable Bluetooth stack and start LE advertisements" help Auto-Enable the Bluetooth stack and start advertising with the NUS UUID. Useful to run applications that inherently do not deal with Bluetooth (e.g: Non-Bluetooth samples using UART over Bluetooth LE). -endif # BT_NUS +endif # BT_ZEPHYR_NUS diff --git a/subsys/bluetooth/services/nus/nus.c b/subsys/bluetooth/services/nus/nus.c index 3dc2fbe6ca1..1f6eec8c25f 100644 --- a/subsys/bluetooth/services/nus/nus.c +++ b/subsys/bluetooth/services/nus/nus.c @@ -49,7 +49,7 @@ int bt_nus_inst_cb_register(struct bt_nus_inst *instance, struct bt_nus_cb *cb, } if (!instance) { - if (IS_ENABLED(CONFIG_BT_NUS_DEFAULT_INSTANCE)) { + if (IS_ENABLED(CONFIG_BT_ZEPHYR_NUS_DEFAULT_INSTANCE)) { instance = bt_nus_inst_default(); } else { return -ENOTSUP; @@ -72,7 +72,7 @@ int bt_nus_inst_send(struct bt_conn *conn, } if (!instance) { - if (IS_ENABLED(CONFIG_BT_NUS_DEFAULT_INSTANCE)) { + if (IS_ENABLED(CONFIG_BT_ZEPHYR_NUS_DEFAULT_INSTANCE)) { instance = bt_nus_inst_default(); } else { return -ENOTSUP; diff --git a/subsys/bluetooth/services/nus/nus_inst.c b/subsys/bluetooth/services/nus/nus_inst.c index 0f88bb8dda8..bd3690f8a7d 100644 --- a/subsys/bluetooth/services/nus/nus_inst.c +++ b/subsys/bluetooth/services/nus/nus_inst.c @@ -6,7 +6,7 @@ #include "nus_internal.h" -#if defined(CONFIG_BT_NUS_DEFAULT_INSTANCE) +#if defined(CONFIG_BT_ZEPHYR_NUS_DEFAULT_INSTANCE) BT_NUS_INST_DEFINE(nus_def); struct bt_nus_inst *bt_nus_inst_default(void) {