From c6132c8fdb993114ddd7a5ee31f07339a5b1a2cb Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Wed, 20 Jan 2021 14:11:01 +0100 Subject: [PATCH] Bluetooth: Seperate BT_ISO and BT_AUDIO ISO is a building block for BT_AUDIO but it is not only useful for AUDIO, and as such should be possible to enable without enabling BT_AUDIO. This commit moves iso.c and iso_internal.h to the host directory (from host/audio) and removes the CMakeLists.txt. The /audio directory is left intact for the Kconfig options it provides, and as a directory for future BLE Audio content. Signed-off-by: Emil Gydesen --- subsys/bluetooth/Kconfig | 1 + subsys/bluetooth/host/CMakeLists.txt | 7 +++++-- subsys/bluetooth/host/audio/CMakeLists.txt | 6 ------ subsys/bluetooth/host/buf.c | 2 +- subsys/bluetooth/host/conn.c | 2 +- subsys/bluetooth/host/conn_internal.h | 2 +- subsys/bluetooth/host/hci_core.c | 2 +- subsys/bluetooth/host/{audio => }/iso.c | 0 subsys/bluetooth/host/{audio => }/iso_internal.h | 0 9 files changed, 10 insertions(+), 12 deletions(-) delete mode 100644 subsys/bluetooth/host/audio/CMakeLists.txt rename subsys/bluetooth/host/{audio => }/iso.c (100%) rename subsys/bluetooth/host/{audio => }/iso_internal.h (100%) diff --git a/subsys/bluetooth/Kconfig b/subsys/bluetooth/Kconfig index 4cac0607612..5dd15141a59 100644 --- a/subsys/bluetooth/Kconfig +++ b/subsys/bluetooth/Kconfig @@ -225,6 +225,7 @@ endif # BT_CONN config BT_ISO bool "Bluetooth Isochronous Channel Support [EXPERIMENTAL]" + depends on BT_CONN help Select this to enable Isochronous Channel support. diff --git a/subsys/bluetooth/host/CMakeLists.txt b/subsys/bluetooth/host/CMakeLists.txt index 408431f9420..21bc9dd5680 100644 --- a/subsys/bluetooth/host/CMakeLists.txt +++ b/subsys/bluetooth/host/CMakeLists.txt @@ -60,6 +60,11 @@ if(CONFIG_BT_HCI_HOST) endif() endif() + zephyr_library_sources_ifdef( + CONFIG_BT_ISO + iso.c + ) + if(CONFIG_BT_DF) zephyr_library_sources( direction.c @@ -101,5 +106,3 @@ if(CONFIG_BT_CONN_DISABLE_SECURITY) Do not use in production." ) endif() - -add_subdirectory_ifdef(CONFIG_BT_AUDIO audio) diff --git a/subsys/bluetooth/host/audio/CMakeLists.txt b/subsys/bluetooth/host/audio/CMakeLists.txt deleted file mode 100644 index 24a92c44519..00000000000 --- a/subsys/bluetooth/host/audio/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -zephyr_library() -zephyr_library_link_libraries(subsys__bluetooth) - -zephyr_library_sources_ifdef(CONFIG_BT_ISO iso.c) diff --git a/subsys/bluetooth/host/buf.c b/subsys/bluetooth/host/buf.c index a1e7addf96e..513e0cda65b 100644 --- a/subsys/bluetooth/host/buf.c +++ b/subsys/bluetooth/host/buf.c @@ -10,7 +10,7 @@ #include "hci_core.h" #include "conn_internal.h" -#include "audio/iso_internal.h" +#include "iso_internal.h" #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_CORE) #define LOG_MODULE_NAME bt_buf diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index c03851b0604..12ce2e2ef7d 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -35,7 +35,7 @@ #include "ssp.h" #include "att_internal.h" #include "gatt_internal.h" -#include "audio/iso_internal.h" +#include "iso_internal.h" /* Peripheral timeout to initialize Connection Parameter Update procedure */ #define CONN_UPDATE_TIMEOUT K_MSEC(CONFIG_BT_CONN_PARAM_UPDATE_TIMEOUT) diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index d9e1b4f5f7d..c73e9ebbb00 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -182,7 +182,7 @@ struct bt_conn { struct bt_conn_br br; struct bt_conn_sco sco; #endif -#if defined(CONFIG_BT_AUDIO) +#if defined(CONFIG_BT_ISO) struct bt_conn_iso iso; #endif }; diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 7c9ea433c7a..acbfa85475e 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -40,7 +40,7 @@ #include "ecc.h" #include "conn_internal.h" -#include "audio/iso_internal.h" +#include "iso_internal.h" #include "l2cap_internal.h" #include "gatt_internal.h" #include "smp.h" diff --git a/subsys/bluetooth/host/audio/iso.c b/subsys/bluetooth/host/iso.c similarity index 100% rename from subsys/bluetooth/host/audio/iso.c rename to subsys/bluetooth/host/iso.c diff --git a/subsys/bluetooth/host/audio/iso_internal.h b/subsys/bluetooth/host/iso_internal.h similarity index 100% rename from subsys/bluetooth/host/audio/iso_internal.h rename to subsys/bluetooth/host/iso_internal.h