Browse Source

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 <luisf@croxel.com>
pull/70957/head
Luis Ubieda 1 year ago committed by Johan Hedberg
parent
commit
92e0d0bbfc
  1. 4
      doc/releases/release-notes-3.7.rst
  2. 2
      drivers/serial/Kconfig.bt
  3. 2
      include/zephyr/linker/common-ram.ld
  4. 2
      samples/bluetooth/peripheral_nus/prj.conf
  5. 4
      samples/subsys/logging/logger/overlay-bt.conf
  6. 4
      samples/subsys/shell/shell_module/overlay-bt.conf
  7. 2
      snippets/nus-console/README.rst
  8. 4
      snippets/nus-console/nus-console.conf
  9. 2
      subsys/bluetooth/services/CMakeLists.txt
  10. 2
      subsys/bluetooth/services/nus/CMakeLists.txt
  11. 10
      subsys/bluetooth/services/nus/Kconfig.nus
  12. 4
      subsys/bluetooth/services/nus/nus.c
  13. 2
      subsys/bluetooth/services/nus/nus_inst.c

4
doc/releases/release-notes-3.7.rst

@ -37,7 +37,7 @@ Architectures @@ -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 @@ -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).

2
drivers/serial/Kconfig.bt

@ -3,7 +3,7 @@ @@ -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

2
include/zephyr/linker/common-ram.ld

@ -140,7 +140,7 @@ @@ -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

2
samples/bluetooth/peripheral_nus/prj.conf

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_NUS=y
CONFIG_BT_ZEPHYR_NUS=y

4
samples/subsys/logging/logger/overlay-bt.conf

@ -4,9 +4,9 @@ CONFIG_UART_CONSOLE=y @@ -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

4
samples/subsys/shell/shell_module/overlay-bt.conf

@ -4,9 +4,9 @@ CONFIG_UART_CONSOLE=y @@ -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

2
snippets/nus-console/README.rst

@ -20,7 +20,7 @@ Hardware support for: @@ -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`

4
snippets/nus-console/nus-console.conf

@ -4,9 +4,9 @@ CONFIG_UART_CONSOLE=y @@ -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

2
subsys/bluetooth/services/CMakeLists.txt

@ -17,6 +17,6 @@ if(CONFIG_BT_IAS OR CONFIG_BT_IAS_CLIENT) @@ -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()

2
subsys/bluetooth/services/nus/CMakeLists.txt

@ -9,6 +9,6 @@ zephyr_library_sources( @@ -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
)

10
subsys/bluetooth/services/nus/Kconfig.nus

@ -1,12 +1,12 @@ @@ -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 @@ -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

4
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, @@ -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, @@ -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;

2
subsys/bluetooth/services/nus/nus_inst.c

@ -6,7 +6,7 @@ @@ -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)
{

Loading…
Cancel
Save