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>
This commit is contained in:
Luis Ubieda 2024-03-25 16:08:36 -04:00 committed by Johan Hedberg
parent 8a88cd4805
commit 92e0d0bbfc
13 changed files with 22 additions and 22 deletions

View file

@ -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).

View file

@ -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

View file

@ -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

View file

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

View file

@ -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

View file

@ -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

View file

@ -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`

View file

@ -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

View file

@ -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()

View file

@ -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
)

View file

@ -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

View file

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

View file

@ -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)
{