Skip to content

Commit c8e1b1e

Browse files
Thalleycarlescufi
authored andcommitted
Bluetooth: Audio: Move audio shell to audio directory
Move all audio related shell implementations to the audio directory, to use the same structure as Mesh. Signed-off-by: Emil Gydesen <[email protected]>
1 parent cac932d commit c8e1b1e

24 files changed

+130
-105
lines changed

subsys/bluetooth/audio/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3+
add_subdirectory_ifdef(CONFIG_BT_SHELL shell)
4+
35
zephyr_library()
46
zephyr_library_sources(
57
audio.c
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_library()
4+
zephyr_library_link_libraries(subsys__bluetooth)
5+
6+
zephyr_library_sources_ifdef(
7+
CONFIG_BT_VCP_VOL_REND
8+
vcp_vol_rend.c
9+
)
10+
zephyr_library_sources_ifdef(
11+
CONFIG_BT_VCP_VOL_CTLR
12+
vcp_vol_ctlr.c
13+
)
14+
zephyr_library_sources_ifdef(
15+
CONFIG_BT_MICP_MIC_DEV
16+
micp_mic_dev.c
17+
)
18+
zephyr_library_sources_ifdef(
19+
CONFIG_BT_MICP_MIC_CTLR
20+
micp_mic_ctlr.c
21+
)
22+
zephyr_library_sources_ifdef(
23+
CONFIG_BT_CSIP_SET_MEMBER
24+
csip_set_member.c
25+
)
26+
zephyr_library_sources_ifdef(
27+
CONFIG_BT_CSIP_SET_COORDINATOR
28+
csip_set_coordinator.c
29+
)
30+
zephyr_library_sources_ifdef(
31+
CONFIG_BT_TBS
32+
tbs.c
33+
)
34+
zephyr_library_sources_ifdef(
35+
CONFIG_BT_TBS_CLIENT
36+
tbs_client.c
37+
)
38+
zephyr_library_sources_ifdef(
39+
CONFIG_BT_MPL
40+
mpl.c
41+
)
42+
zephyr_library_sources_ifdef(
43+
CONFIG_BT_MCC
44+
mcc.c
45+
)
46+
zephyr_library_sources_ifdef(
47+
CONFIG_BT_MCS
48+
media_controller.c
49+
)
50+
zephyr_library_sources_ifdef(
51+
CONFIG_BT_HAS_PRESET_SUPPORT
52+
has.c
53+
)
54+
zephyr_library_sources_ifdef(
55+
CONFIG_BT_CAP_ACCEPTOR_SET_MEMBER
56+
cap_acceptor.c
57+
)
58+
zephyr_library_sources_ifdef(
59+
CONFIG_BT_CAP_INITIATOR
60+
cap_initiator.c
61+
)
62+
zephyr_library_sources_ifdef(
63+
CONFIG_BT_HAS_CLIENT
64+
has_client.c
65+
)
66+
# We use BT_BAP_STREAM as a common ground for audio, as that is set whenever
67+
# any audio stream functionality is enabled.
68+
zephyr_library_sources_ifdef(
69+
CONFIG_BT_BAP_STREAM
70+
bap.c
71+
)
72+
zephyr_library_sources_ifdef(
73+
CONFIG_BT_BAP_SCAN_DELEGATOR
74+
bap_scan_delegator.c
75+
)
76+
zephyr_library_sources_ifdef(
77+
CONFIG_BT_BAP_BROADCAST_ASSISTANT
78+
bap_broadcast_assistant.c
79+
)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/** @file
2+
* @brief Bluetooth audio shell functions
3+
*
4+
* This is not to be included by the application.
5+
*/
6+
7+
/*
8+
* Copyright (c) 2023 Nordic Semiconductor ASA
9+
*
10+
* SPDX-License-Identifier: Apache-2.0
11+
*/
12+
13+
#ifndef __AUDIO_H
14+
#define __AUDIO_H
15+
16+
#include <zephyr/bluetooth/bluetooth.h>
17+
18+
extern struct bt_csip_set_member_svc_inst *svc_inst;
19+
20+
ssize_t audio_ad_data_add(struct bt_data *data, const size_t data_size, const bool discoverable,
21+
const bool connectable);
22+
ssize_t audio_pa_data_add(struct bt_data *data_array, const size_t data_array_size);
23+
ssize_t csis_ad_data_add(struct bt_data *data, const size_t data_size, const bool discoverable);
24+
25+
#endif /* __AUDIO_H */

subsys/bluetooth/shell/bap.c renamed to subsys/bluetooth/audio/shell/bap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <zephyr/bluetooth/audio/bap_lc3_preset.h>
2626
#include <zephyr/bluetooth/audio/pacs.h>
2727

28-
#include "bt.h"
28+
#include "shell/bt.h"
2929

3030
#define LOCATION BT_AUDIO_LOCATION_FRONT_LEFT
3131
#define CONTEXT BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | BT_AUDIO_CONTEXT_TYPE_MEDIA

subsys/bluetooth/shell/bap_broadcast_assistant.c renamed to subsys/bluetooth/audio/shell/bap_broadcast_assistant.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#include <zephyr/bluetooth/hci.h>
1919
#include <zephyr/bluetooth/audio/audio.h>
2020
#include <zephyr/bluetooth/audio/bap.h>
21-
#include "bt.h"
22-
#include "../host/hci_core.h"
21+
#include "shell/bt.h"
22+
#include "../../host/hci_core.h"
2323

2424
static void bap_broadcast_assistant_discover_cb(struct bt_conn *conn, int err,
2525
uint8_t recv_state_count)

subsys/bluetooth/shell/bap_scan_delegator.c renamed to subsys/bluetooth/audio/shell/bap_scan_delegator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <zephyr/bluetooth/gatt.h>
1717
#include <zephyr/bluetooth/bluetooth.h>
1818
#include <zephyr/bluetooth/audio/bap.h>
19-
#include "bt.h"
19+
#include "shell/bt.h"
2020

2121
static void pa_synced(struct bt_bap_scan_delegator_recv_state *recv_state,
2222
const struct bt_le_per_adv_sync_synced_info *info)

subsys/bluetooth/shell/cap_acceptor.c renamed to subsys/bluetooth/audio/shell/cap_acceptor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <zephyr/bluetooth/gatt.h>
1414
#include <zephyr/bluetooth/bluetooth.h>
1515
#include <zephyr/bluetooth/audio/cap.h>
16-
#include "bt.h"
16+
#include "shell/bt.h"
1717

1818
extern const struct shell *ctx_shell;
1919
static struct bt_csip_set_member_svc_inst *cap_csip_svc_inst;

subsys/bluetooth/shell/cap_initiator.c renamed to subsys/bluetooth/audio/shell/cap_initiator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <zephyr/bluetooth/bluetooth.h>
1616
#include <zephyr/bluetooth/audio/cap.h>
1717

18-
#include "bt.h"
18+
#include "shell/bt.h"
1919

2020
#if defined(CONFIG_BT_BAP_UNICAST_CLIENT)
2121

subsys/bluetooth/shell/csip_set_coordinator.c renamed to subsys/bluetooth/audio/shell/csip_set_coordinator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <zephyr/bluetooth/gatt.h>
1919
#include <zephyr/bluetooth/bluetooth.h>
2020

21-
#include "bt.h"
21+
#include "shell/bt.h"
2222

2323
#include <zephyr/bluetooth/audio/csip.h>
2424

subsys/bluetooth/shell/csip_set_member.c renamed to subsys/bluetooth/audio/shell/csip_set_member.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <zephyr/bluetooth/gatt.h>
1818
#include <zephyr/bluetooth/bluetooth.h>
1919
#include <zephyr/bluetooth/audio/csip.h>
20-
#include "bt.h"
20+
#include "shell/bt.h"
2121

2222
extern const struct shell *ctx_shell;
2323
struct bt_csip_set_member_svc_inst *svc_inst;

0 commit comments

Comments
 (0)