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:
parent
8a88cd4805
commit
92e0d0bbfc
13 changed files with 22 additions and 22 deletions
|
|
@ -37,7 +37,7 @@ Architectures
|
||||||
Bluetooth
|
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,
|
This Service exposes the ability to declare multiple instances of the GATT service,
|
||||||
allowing multiple serial endpoints to be used for different purposes.
|
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
|
* 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
|
which allows non-Bluetooth samples that use the UART APIs to run without modifications
|
||||||
(e.g: Console and Logging examples).
|
(e.g: Console and Logging examples).
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
config UART_BT
|
config UART_BT
|
||||||
bool "UART over NUS Bluetooth LE"
|
bool "UART over NUS Bluetooth LE"
|
||||||
depends on BT_NUS
|
depends on BT_ZEPHYR_NUS
|
||||||
depends on DT_HAS_ZEPHYR_NUS_UART_ENABLED
|
depends on DT_HAS_ZEPHYR_NUS_UART_ENABLED
|
||||||
select UART_INTERRUPT_DRIVEN
|
select UART_INTERRUPT_DRIVEN
|
||||||
select RING_BUFFER
|
select RING_BUFFER
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@
|
||||||
ITERABLE_SECTION_RAM(device_mutable, 4)
|
ITERABLE_SECTION_RAM(device_mutable, 4)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_BT_NUS)
|
#if defined(CONFIG_BT_ZEPHYR_NUS)
|
||||||
ITERABLE_SECTION_RAM(bt_nus_inst, 4)
|
ITERABLE_SECTION_RAM(bt_nus_inst, 4)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
CONFIG_BT=y
|
CONFIG_BT=y
|
||||||
CONFIG_BT_PERIPHERAL=y
|
CONFIG_BT_PERIPHERAL=y
|
||||||
CONFIG_BT_NUS=y
|
CONFIG_BT_ZEPHYR_NUS=y
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ CONFIG_UART_CONSOLE=y
|
||||||
|
|
||||||
CONFIG_BT=y
|
CONFIG_BT=y
|
||||||
CONFIG_BT_PERIPHERAL=y
|
CONFIG_BT_PERIPHERAL=y
|
||||||
CONFIG_BT_NUS=y
|
CONFIG_BT_ZEPHYR_NUS=y
|
||||||
CONFIG_UART_BT=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.
|
# Bluetooth optimizations to allow larger data packets.
|
||||||
CONFIG_BT_RX_STACK_SIZE=2048
|
CONFIG_BT_RX_STACK_SIZE=2048
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ CONFIG_UART_CONSOLE=y
|
||||||
|
|
||||||
CONFIG_BT=y
|
CONFIG_BT=y
|
||||||
CONFIG_BT_PERIPHERAL=y
|
CONFIG_BT_PERIPHERAL=y
|
||||||
CONFIG_BT_NUS=y
|
CONFIG_BT_ZEPHYR_NUS=y
|
||||||
CONFIG_UART_BT=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.
|
# Bluetooth optimizations to allow larger data packets.
|
||||||
CONFIG_BT_RX_STACK_SIZE=2048
|
CONFIG_BT_RX_STACK_SIZE=2048
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ Hardware support for:
|
||||||
|
|
||||||
- :kconfig:option:`CONFIG_BT`
|
- :kconfig:option:`CONFIG_BT`
|
||||||
- :kconfig:option:`CONFIG_BT_PERIPHERAL`
|
- :kconfig:option:`CONFIG_BT_PERIPHERAL`
|
||||||
- :kconfig:option:`CONFIG_BT_NUS`
|
- :kconfig:option:`CONFIG_BT_ZEPHYR_NUS`
|
||||||
- :kconfig:option:`CONFIG_SERIAL`
|
- :kconfig:option:`CONFIG_SERIAL`
|
||||||
- :kconfig:option:`CONFIG_CONSOLE`
|
- :kconfig:option:`CONFIG_CONSOLE`
|
||||||
- :kconfig:option:`CONFIG_UART_CONSOLE`
|
- :kconfig:option:`CONFIG_UART_CONSOLE`
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ CONFIG_UART_CONSOLE=y
|
||||||
|
|
||||||
CONFIG_BT=y
|
CONFIG_BT=y
|
||||||
CONFIG_BT_PERIPHERAL=y
|
CONFIG_BT_PERIPHERAL=y
|
||||||
CONFIG_BT_NUS=y
|
CONFIG_BT_ZEPHYR_NUS=y
|
||||||
CONFIG_UART_BT=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.
|
# Bluetooth optimizations to allow larger data packets.
|
||||||
CONFIG_BT_RX_STACK_SIZE=2048
|
CONFIG_BT_RX_STACK_SIZE=2048
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,6 @@ if(CONFIG_BT_IAS OR CONFIG_BT_IAS_CLIENT)
|
||||||
add_subdirectory(ias)
|
add_subdirectory(ias)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_BT_NUS)
|
if(CONFIG_BT_ZEPHYR_NUS)
|
||||||
add_subdirectory(nus)
|
add_subdirectory(nus)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,6 @@ zephyr_library_sources(
|
||||||
nus_inst.c
|
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
|
bt_nus_auto_start_bt.c
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
# Copyright (c) 2024 Croxel, Inc.
|
# Copyright (c) 2024 Croxel, Inc.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
menuconfig BT_NUS
|
menuconfig BT_ZEPHYR_NUS
|
||||||
bool "GATT Nordic UART Service"
|
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"
|
bool "Use default NUS Service instance"
|
||||||
default y if !UART_BT
|
default y if !UART_BT
|
||||||
help
|
help
|
||||||
|
|
@ -16,11 +16,11 @@ config BT_NUS_DEFAULT_INSTANCE
|
||||||
BT_NUS_INST_DEFINE(), it may not be beneficial having an internal
|
BT_NUS_INST_DEFINE(), it may not be beneficial having an internal
|
||||||
instance as well.
|
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"
|
bool "Auto-enable Bluetooth stack and start LE advertisements"
|
||||||
help
|
help
|
||||||
Auto-Enable the Bluetooth stack and start advertising with the NUS
|
Auto-Enable the Bluetooth stack and start advertising with the NUS
|
||||||
UUID. Useful to run applications that inherently do not deal with
|
UUID. Useful to run applications that inherently do not deal with
|
||||||
Bluetooth (e.g: Non-Bluetooth samples using UART over Bluetooth LE).
|
Bluetooth (e.g: Non-Bluetooth samples using UART over Bluetooth LE).
|
||||||
|
|
||||||
endif # BT_NUS
|
endif # BT_ZEPHYR_NUS
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ int bt_nus_inst_cb_register(struct bt_nus_inst *instance, struct bt_nus_cb *cb,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!instance) {
|
if (!instance) {
|
||||||
if (IS_ENABLED(CONFIG_BT_NUS_DEFAULT_INSTANCE)) {
|
if (IS_ENABLED(CONFIG_BT_ZEPHYR_NUS_DEFAULT_INSTANCE)) {
|
||||||
instance = bt_nus_inst_default();
|
instance = bt_nus_inst_default();
|
||||||
} else {
|
} else {
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
@ -72,7 +72,7 @@ int bt_nus_inst_send(struct bt_conn *conn,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!instance) {
|
if (!instance) {
|
||||||
if (IS_ENABLED(CONFIG_BT_NUS_DEFAULT_INSTANCE)) {
|
if (IS_ENABLED(CONFIG_BT_ZEPHYR_NUS_DEFAULT_INSTANCE)) {
|
||||||
instance = bt_nus_inst_default();
|
instance = bt_nus_inst_default();
|
||||||
} else {
|
} else {
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include "nus_internal.h"
|
#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);
|
BT_NUS_INST_DEFINE(nus_def);
|
||||||
struct bt_nus_inst *bt_nus_inst_default(void)
|
struct bt_nus_inst *bt_nus_inst_default(void)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue