diff --git a/subsys/bluetooth/audio/otc.h b/include/bluetooth/services/otc.h similarity index 98% rename from subsys/bluetooth/audio/otc.h rename to include/bluetooth/services/otc.h index f67fb7b4b06..1a7b63ef7df 100644 --- a/subsys/bluetooth/audio/otc.h +++ b/include/bluetooth/services/otc.h @@ -7,10 +7,8 @@ * * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_INCLUDE_BLUETOOTH_HOST_AUDIO_OTC_H_ -#define ZEPHYR_INCLUDE_BLUETOOTH_HOST_AUDIO_OTC_H_ - -/* TODO: Temporarily here - clean up, and move alongside the Object Transfer Service */ +#ifndef ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_OTC_H_ +#define ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_OTC_H_ #include #include @@ -557,4 +555,4 @@ void bt_otc_metadata_display(struct bt_otc_obj_metadata *metadata, } #endif -#endif /* ZEPHYR_INCLUDE_BLUETOOTH_HOST_AUDIO_OTC_H_ */ +#endif /* ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_OTC_H_ */ diff --git a/subsys/bluetooth/audio/CMakeLists.txt b/subsys/bluetooth/audio/CMakeLists.txt index fac2b0e5a6b..aa611bb25b8 100644 --- a/subsys/bluetooth/audio/CMakeLists.txt +++ b/subsys/bluetooth/audio/CMakeLists.txt @@ -32,8 +32,6 @@ if (CONFIG_BT_CSIS OR CONFIG_BT_CSIS_CLIENT) zephyr_library_sources(csis_crypto.c) endif() -zephyr_library_sources_ifdef(CONFIG_BT_OTC otc.c) - zephyr_library_sources_ifdef(CONFIG_BT_MCC mcc.c) zephyr_library_sources_ifdef(CONFIG_BT_MCS mcs.c) diff --git a/subsys/bluetooth/audio/Kconfig b/subsys/bluetooth/audio/Kconfig index 7677766c72d..41f15db3be0 100644 --- a/subsys/bluetooth/audio/Kconfig +++ b/subsys/bluetooth/audio/Kconfig @@ -31,7 +31,6 @@ rsource "Kconfig.aics" rsource "Kconfig.vcs" rsource "Kconfig.mics" rsource "Kconfig.csis" -rsource "Kconfig.otc" rsource "Kconfig.mcs" endif # BT_AUDIO diff --git a/subsys/bluetooth/audio/mcc.c b/subsys/bluetooth/audio/mcc.c index e85292a10f1..a881edffd26 100644 --- a/subsys/bluetooth/audio/mcc.c +++ b/subsys/bluetooth/audio/mcc.c @@ -20,8 +20,8 @@ #include #include -#include "otc.h" -#include "otc_internal.h" +#include +#include "../services/ots/otc_internal.h" /* TODO: Temporarily copied here from media_proxy_internal.h - clean up */ /* Debug output of 48 bit Object ID value */ diff --git a/subsys/bluetooth/services/CMakeLists.txt b/subsys/bluetooth/services/CMakeLists.txt index 788ac12a7ff..3306083cdeb 100644 --- a/subsys/bluetooth/services/CMakeLists.txt +++ b/subsys/bluetooth/services/CMakeLists.txt @@ -9,4 +9,6 @@ zephyr_sources_ifdef(CONFIG_BT_HRS hrs.c) zephyr_sources_ifdef(CONFIG_BT_TPS tps.c) -add_subdirectory_ifdef(CONFIG_BT_OTS ots) +if(CONFIG_BT_OTS OR CONFIG_BT_OTC) + add_subdirectory(ots) +endif() diff --git a/subsys/bluetooth/services/Kconfig b/subsys/bluetooth/services/Kconfig index d898e2a496a..88dedaa4111 100644 --- a/subsys/bluetooth/services/Kconfig +++ b/subsys/bluetooth/services/Kconfig @@ -15,5 +15,6 @@ rsource "Kconfig.hrs" rsource "Kconfig.tps" rsource "ots/Kconfig" +rsource "ots/Kconfig.otc" endmenu diff --git a/subsys/bluetooth/services/ots/CMakeLists.txt b/subsys/bluetooth/services/ots/CMakeLists.txt index 6978d614f0f..cb6da89ecea 100644 --- a/subsys/bluetooth/services/ots/CMakeLists.txt +++ b/subsys/bluetooth/services/ots/CMakeLists.txt @@ -9,3 +9,5 @@ zephyr_sources_ifdef( ots_olcp.c) zephyr_library_sources_ifdef(CONFIG_BT_OTS_DIR_LIST_OBJ ots_dir_list.c) + +zephyr_library_sources_ifdef(CONFIG_BT_OTC otc.c) diff --git a/subsys/bluetooth/audio/Kconfig.otc b/subsys/bluetooth/services/ots/Kconfig.otc similarity index 100% rename from subsys/bluetooth/audio/Kconfig.otc rename to subsys/bluetooth/services/ots/Kconfig.otc diff --git a/subsys/bluetooth/audio/otc.c b/subsys/bluetooth/services/ots/otc.c similarity index 99% rename from subsys/bluetooth/audio/otc.c rename to subsys/bluetooth/services/ots/otc.c index 8546cd4c955..f56b411a1df 100644 --- a/subsys/bluetooth/audio/otc.c +++ b/subsys/bluetooth/services/ots/otc.c @@ -6,8 +6,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* TODO: Temporarily here - clean up, and move alongside the Object Transfer Service */ - #include #include @@ -20,11 +18,11 @@ #include #include -#include "../host/conn_internal.h" /* To avoid build errors on use of struct bt_conn" */ +#include "../../host/conn_internal.h" /* To avoid build errors on use of struct bt_conn" */ #include +#include #include "otc_internal.h" -#include "otc.h" #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_OTC) #define LOG_MODULE_NAME bt_otc diff --git a/subsys/bluetooth/audio/otc_internal.h b/subsys/bluetooth/services/ots/otc_internal.h similarity index 98% rename from subsys/bluetooth/audio/otc_internal.h rename to subsys/bluetooth/services/ots/otc_internal.h index c7fdabae263..c239631e186 100644 --- a/subsys/bluetooth/audio/otc_internal.h +++ b/subsys/bluetooth/services/ots/otc_internal.h @@ -12,7 +12,7 @@ /* TODO: Temporarily here - clean up, and move alongside the Object Transfer Service */ -#include "otc.h" +#include #ifdef __cplusplus extern "C" { diff --git a/subsys/bluetooth/shell/mcc.c b/subsys/bluetooth/shell/mcc.c index d8fe15bd8c1..d6adf7a8d12 100644 --- a/subsys/bluetooth/shell/mcc.c +++ b/subsys/bluetooth/shell/mcc.c @@ -17,7 +17,7 @@ #include "bt.h" -#include "../audio/otc.h" +#include "../services/ots/otc_internal.h" #include "../audio/media_proxy_internal.h" #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_MCC) diff --git a/tests/bluetooth/bsim_bt/bsim_test_audio/src/mcc_test.c b/tests/bluetooth/bsim_bt/bsim_test_audio/src/mcc_test.c index dac72bf31d7..490ed240f1b 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_audio/src/mcc_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_audio/src/mcc_test.c @@ -23,7 +23,7 @@ #include #include -#include "../../../../../subsys/bluetooth/audio/otc.h" +#include #include "common.h" diff --git a/tests/bluetooth/bsim_bt/bsim_test_audio/src/media_controller_test.c b/tests/bluetooth/bsim_bt/bsim_test_audio/src/media_controller_test.c index 0fe5c28da09..ed8fcf58c1f 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_audio/src/media_controller_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_audio/src/media_controller_test.c @@ -23,7 +23,7 @@ #include #include -#include "../../../../../subsys/bluetooth/audio/otc.h" +#include #include "common.h"