diff --git a/subsys/bluetooth/host/CMakeLists.txt b/subsys/bluetooth/host/CMakeLists.txt index e5ac8c707e0..56cdfb04575 100644 --- a/subsys/bluetooth/host/CMakeLists.txt +++ b/subsys/bluetooth/host/CMakeLists.txt @@ -3,32 +3,16 @@ zephyr_library() zephyr_library_link_libraries(subsys__bluetooth) +add_subdirectory_ifdef(CONFIG_BT_CLASSIC classic) + zephyr_library_sources_ifdef(CONFIG_BT_HCI_RAW hci_raw.c hci_common.c) zephyr_library_sources_ifdef(CONFIG_BT_MONITOR monitor.c) zephyr_library_sources_ifdef(CONFIG_BT_TINYCRYPT_ECC hci_ecc.c) -zephyr_library_sources_ifdef(CONFIG_BT_A2DP a2dp.c) -zephyr_library_sources_ifdef(CONFIG_BT_AVDTP avdtp.c) -zephyr_library_sources_ifdef(CONFIG_BT_RFCOMM rfcomm.c) zephyr_library_sources_ifdef(CONFIG_BT_TESTING testing.c) zephyr_library_sources_ifdef(CONFIG_BT_SETTINGS settings.c) zephyr_library_sources_ifdef(CONFIG_BT_HOST_CCM aes_ccm.c) zephyr_library_sources_ifdef(CONFIG_BT_LONG_WQ long_wq.c) -zephyr_library_sources_ifdef( - CONFIG_BT_BREDR - br.c - keys_br.c - l2cap_br.c - sdp.c - ssp.c - ) - -zephyr_library_sources_ifdef( - CONFIG_BT_HFP_HF - hfp_hf.c - at.c - ) - if(CONFIG_BT_HCI_HOST) zephyr_library_sources( uuid.c diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index aae4a5151f9..0b0e75dee18 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -1029,6 +1029,7 @@ config BT_CONN_DISABLE_SECURITY config BT_BREDR bool "Bluetooth BR/EDR support [EXPERIMENTAL]" depends on BT_HCI_HOST + select BT_CLASSIC select BT_PERIPHERAL select BT_CENTRAL select BT_SMP @@ -1037,6 +1038,13 @@ config BT_BREDR help This option enables Bluetooth BR/EDR support +config BT_CLASSIC + bool "Bluetooth classic(BR/EDR) support [EXPERIMENTAL]" + depends on BT_BREDR + select EXPERIMENTAL + help + This option enables Bluetooth classic(BR/EDR) support + if BT_BREDR config BT_MAX_SCO_CONN int "Maximum number of simultaneous SCO connections" diff --git a/subsys/bluetooth/host/classic/CMakeLists.txt b/subsys/bluetooth/host/classic/CMakeLists.txt new file mode 100644 index 00000000000..b36e3a46db3 --- /dev/null +++ b/subsys/bluetooth/host/classic/CMakeLists.txt @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: Apache-2.0 + +zephyr_library() +zephyr_library_link_libraries(subsys__bluetooth) + +zephyr_library_sources_ifdef(CONFIG_BT_A2DP a2dp.c) +zephyr_library_sources_ifdef(CONFIG_BT_AVDTP avdtp.c) +zephyr_library_sources_ifdef(CONFIG_BT_RFCOMM rfcomm.c) + +zephyr_library_sources_ifdef( + CONFIG_BT_BREDR + br.c + keys_br.c + l2cap_br.c + sdp.c + ssp.c + ) + +zephyr_library_sources_ifdef( + CONFIG_BT_HFP_HF + hfp_hf.c + at.c + ) diff --git a/subsys/bluetooth/host/a2dp.c b/subsys/bluetooth/host/classic/a2dp.c similarity index 98% rename from subsys/bluetooth/host/a2dp.c rename to subsys/bluetooth/host/classic/a2dp.c index 1af7753306e..f6eda168127 100644 --- a/subsys/bluetooth/host/a2dp.c +++ b/subsys/bluetooth/host/classic/a2dp.c @@ -23,8 +23,8 @@ #include "common/assert.h" -#include "hci_core.h" -#include "conn_internal.h" +#include "host/hci_core.h" +#include "host/conn_internal.h" #include "avdtp_internal.h" #include "a2dp_internal.h" diff --git a/subsys/bluetooth/host/a2dp_internal.h b/subsys/bluetooth/host/classic/a2dp_internal.h similarity index 100% rename from subsys/bluetooth/host/a2dp_internal.h rename to subsys/bluetooth/host/classic/a2dp_internal.h diff --git a/subsys/bluetooth/host/at.c b/subsys/bluetooth/host/classic/at.c similarity index 100% rename from subsys/bluetooth/host/at.c rename to subsys/bluetooth/host/classic/at.c diff --git a/subsys/bluetooth/host/at.h b/subsys/bluetooth/host/classic/at.h similarity index 100% rename from subsys/bluetooth/host/at.h rename to subsys/bluetooth/host/classic/at.h diff --git a/subsys/bluetooth/host/avdtp.c b/subsys/bluetooth/host/classic/avdtp.c similarity index 99% rename from subsys/bluetooth/host/avdtp.c rename to subsys/bluetooth/host/classic/avdtp.c index 9f9b63dfe4f..aee20f53532 100644 --- a/subsys/bluetooth/host/avdtp.c +++ b/subsys/bluetooth/host/classic/avdtp.c @@ -18,8 +18,8 @@ #include #include -#include "hci_core.h" -#include "conn_internal.h" +#include "host/hci_core.h" +#include "host/conn_internal.h" #include "l2cap_br_internal.h" #include "avdtp_internal.h" diff --git a/subsys/bluetooth/host/avdtp_internal.h b/subsys/bluetooth/host/classic/avdtp_internal.h similarity index 100% rename from subsys/bluetooth/host/avdtp_internal.h rename to subsys/bluetooth/host/classic/avdtp_internal.h diff --git a/subsys/bluetooth/host/br.c b/subsys/bluetooth/host/classic/br.c similarity index 99% rename from subsys/bluetooth/host/br.c rename to subsys/bluetooth/host/classic/br.c index 8eaf382c9a2..54321a3dfc7 100644 --- a/subsys/bluetooth/host/br.c +++ b/subsys/bluetooth/host/classic/br.c @@ -13,9 +13,9 @@ #include "common/bt_str.h" -#include "hci_core.h" -#include "conn_internal.h" -#include "keys.h" +#include "host/hci_core.h" +#include "host/conn_internal.h" +#include "host/keys.h" #define LOG_LEVEL CONFIG_BT_HCI_CORE_LOG_LEVEL #include diff --git a/subsys/bluetooth/host/br.h b/subsys/bluetooth/host/classic/br.h similarity index 100% rename from subsys/bluetooth/host/br.h rename to subsys/bluetooth/host/classic/br.h diff --git a/subsys/bluetooth/host/hfp_hf.c b/subsys/bluetooth/host/classic/hfp_hf.c similarity index 99% rename from subsys/bluetooth/host/hfp_hf.c rename to subsys/bluetooth/host/classic/hfp_hf.c index 4b0e82ee3c7..63ced987f18 100644 --- a/subsys/bluetooth/host/hfp_hf.c +++ b/subsys/bluetooth/host/classic/hfp_hf.c @@ -19,8 +19,8 @@ #include #include -#include "hci_core.h" -#include "conn_internal.h" +#include "host/hci_core.h" +#include "host/conn_internal.h" #include "l2cap_br_internal.h" #include "rfcomm_internal.h" #include "at.h" diff --git a/subsys/bluetooth/host/hfp_internal.h b/subsys/bluetooth/host/classic/hfp_internal.h similarity index 100% rename from subsys/bluetooth/host/hfp_internal.h rename to subsys/bluetooth/host/classic/hfp_internal.h diff --git a/subsys/bluetooth/host/keys_br.c b/subsys/bluetooth/host/classic/keys_br.c similarity index 98% rename from subsys/bluetooth/host/keys_br.c rename to subsys/bluetooth/host/classic/keys_br.c index 47799d49289..2ce745de678 100644 --- a/subsys/bluetooth/host/keys_br.c +++ b/subsys/bluetooth/host/classic/keys_br.c @@ -18,9 +18,9 @@ #include "common/bt_str.h" -#include "hci_core.h" -#include "settings.h" -#include "keys.h" +#include "host/hci_core.h" +#include "host/settings.h" +#include "host/keys.h" #define LOG_LEVEL CONFIG_BT_KEYS_LOG_LEVEL #include diff --git a/subsys/bluetooth/host/l2cap_br.c b/subsys/bluetooth/host/classic/l2cap_br.c similarity index 99% rename from subsys/bluetooth/host/l2cap_br.c rename to subsys/bluetooth/host/classic/l2cap_br.c index d042ac7962d..f1765105e08 100644 --- a/subsys/bluetooth/host/l2cap_br.c +++ b/subsys/bluetooth/host/classic/l2cap_br.c @@ -19,8 +19,8 @@ #include #include -#include "hci_core.h" -#include "conn_internal.h" +#include "host/hci_core.h" +#include "host/conn_internal.h" #include "l2cap_br_internal.h" #include "avdtp_internal.h" #include "a2dp_internal.h" diff --git a/subsys/bluetooth/host/l2cap_br_interface.h b/subsys/bluetooth/host/classic/l2cap_br_interface.h similarity index 100% rename from subsys/bluetooth/host/l2cap_br_interface.h rename to subsys/bluetooth/host/classic/l2cap_br_interface.h diff --git a/subsys/bluetooth/host/l2cap_br_internal.h b/subsys/bluetooth/host/classic/l2cap_br_internal.h similarity index 100% rename from subsys/bluetooth/host/l2cap_br_internal.h rename to subsys/bluetooth/host/classic/l2cap_br_internal.h diff --git a/subsys/bluetooth/host/rfcomm.c b/subsys/bluetooth/host/classic/rfcomm.c similarity index 99% rename from subsys/bluetooth/host/rfcomm.c rename to subsys/bluetooth/host/classic/rfcomm.c index 16e771c659d..d95a712f534 100644 --- a/subsys/bluetooth/host/rfcomm.c +++ b/subsys/bluetooth/host/classic/rfcomm.c @@ -22,8 +22,8 @@ #include -#include "hci_core.h" -#include "conn_internal.h" +#include "host/hci_core.h" +#include "host/conn_internal.h" #include "l2cap_br_internal.h" #include "rfcomm_internal.h" diff --git a/subsys/bluetooth/host/rfcomm_internal.h b/subsys/bluetooth/host/classic/rfcomm_internal.h similarity index 100% rename from subsys/bluetooth/host/rfcomm_internal.h rename to subsys/bluetooth/host/classic/rfcomm_internal.h diff --git a/subsys/bluetooth/host/sdp.c b/subsys/bluetooth/host/classic/sdp.c similarity index 99% rename from subsys/bluetooth/host/sdp.c rename to subsys/bluetooth/host/classic/sdp.c index b93b5ccc362..7cec5b05f9f 100644 --- a/subsys/bluetooth/host/sdp.c +++ b/subsys/bluetooth/host/classic/sdp.c @@ -19,8 +19,8 @@ #include "common/bt_str.h" #include "common/assert.h" -#include "hci_core.h" -#include "conn_internal.h" +#include "host/hci_core.h" +#include "host/conn_internal.h" #include "l2cap_br_internal.h" #include "sdp_internal.h" diff --git a/subsys/bluetooth/host/sdp_internal.h b/subsys/bluetooth/host/classic/sdp_internal.h similarity index 100% rename from subsys/bluetooth/host/sdp_internal.h rename to subsys/bluetooth/host/classic/sdp_internal.h diff --git a/subsys/bluetooth/host/ssp.c b/subsys/bluetooth/host/classic/ssp.c similarity index 99% rename from subsys/bluetooth/host/ssp.c rename to subsys/bluetooth/host/classic/ssp.c index 814a35b32fb..72ac72624a7 100644 --- a/subsys/bluetooth/host/ssp.c +++ b/subsys/bluetooth/host/classic/ssp.c @@ -15,10 +15,10 @@ #include "common/bt_str.h" -#include "keys.h" +#include "host/keys.h" -#include "hci_core.h" -#include "conn_internal.h" +#include "host/hci_core.h" +#include "host/conn_internal.h" #define LOG_LEVEL CONFIG_BT_HCI_CORE_LOG_LEVEL #include diff --git a/subsys/bluetooth/host/ssp.h b/subsys/bluetooth/host/classic/ssp.h similarity index 100% rename from subsys/bluetooth/host/ssp.h rename to subsys/bluetooth/host/classic/ssp.h diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 88d9a8b6dff..c6b54f50ca7 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -38,7 +38,7 @@ #include "l2cap_internal.h" #include "keys.h" #include "smp.h" -#include "ssp.h" +#include "classic/ssp.h" #include "att_internal.h" #include "iso_internal.h" #include "direction_internal.h" diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 0c6a96e2aec..91e1deb904a 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -52,7 +52,7 @@ #include "settings.h" #if defined(CONFIG_BT_BREDR) -#include "br.h" +#include "classic/br.h" #endif #if defined(CONFIG_BT_DF) diff --git a/subsys/bluetooth/host/l2cap_internal.h b/subsys/bluetooth/host/l2cap_internal.h index 43ade8b90d7..599c512f500 100644 --- a/subsys/bluetooth/host/l2cap_internal.h +++ b/subsys/bluetooth/host/l2cap_internal.h @@ -10,7 +10,7 @@ #include #include -#include "l2cap_br_interface.h" +#include "classic/l2cap_br_interface.h" enum l2cap_conn_list_action { BT_L2CAP_CHAN_LOOKUP, diff --git a/tests/bluetooth/at/src/main.c b/tests/bluetooth/at/src/main.c index 5bfdfdd6896..62391d874a0 100644 --- a/tests/bluetooth/at/src/main.c +++ b/tests/bluetooth/at/src/main.c @@ -10,7 +10,7 @@ #include -#include "subsys/bluetooth/host/at.h" +#include "subsys/bluetooth/host/classic/at.h" #include