Skip to content

Commit 0380f11

Browse files
Thalleymbolivar-nordic
authored andcommitted
Bluetooth: Audio: Remove unicast client iso listen
Remove call to bt_audio_stream_iso_listen which calls bt_iso_server_register for the unicast client. Signed-off-by: Emil Gydesen <[email protected]>
1 parent fb8ee77 commit 0380f11

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

subsys/bluetooth/audio/stream.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ int bt_audio_stream_send(struct bt_audio_stream *stream, struct net_buf *buf)
7777
#endif /* CONFIG_BT_AUDIO_UNICAST || CONFIG_BT_AUDIO_BROADCAST_SOURCE */
7878

7979
#if defined(CONFIG_BT_AUDIO_UNICAST)
80-
static struct bt_audio_stream *enabling[CONFIG_BT_ISO_MAX_CHAN];
8180
#if defined(CONFIG_BT_AUDIO_UNICAST_CLIENT)
8281
static struct bt_audio_unicast_group unicast_groups[UNICAST_GROUP_CNT];
8382
#endif /* CONFIG_BT_AUDIO_UNICAST_CLIENT */
8483

84+
#if defined(CONFIG_BT_AUDIO_UNICAST_SERVER)
85+
static struct bt_audio_stream *enabling[CONFIG_BT_ISO_MAX_CHAN];
86+
8587
static int bt_audio_stream_iso_accept(const struct bt_iso_accept_info *info,
8688
struct bt_iso_chan **iso_chan)
8789
{
@@ -150,6 +152,7 @@ int bt_audio_stream_iso_listen(struct bt_audio_stream *stream)
150152

151153
return -ENOSPC;
152154
}
155+
#endif /* CONFIG_BT_AUDIO_UNICAST_SERVER */
153156

154157
bool bt_audio_valid_qos(const struct bt_codec_qos *qos)
155158
{
@@ -235,21 +238,21 @@ void bt_audio_stream_detach(struct bt_audio_stream *stream)
235238

236239
int bt_audio_stream_disconnect(struct bt_audio_stream *stream)
237240
{
238-
int i;
239-
240241
BT_DBG("stream %p iso %p", stream, stream->iso);
241242

242243
if (stream == NULL) {
243244
return -EINVAL;
244245
}
245246

247+
#if defined(CONFIG_BT_AUDIO_UNICAST_SERVER)
246248
/* Stop listening */
247-
for (i = 0; i < ARRAY_SIZE(enabling); i++) {
249+
for (size_t i = 0; i < ARRAY_SIZE(enabling); i++) {
248250
if (enabling[i] == stream) {
249251
enabling[i] = NULL;
250252
break;
251253
}
252254
}
255+
#endif /* CONFIG_BT_AUDIO_UNICAST_SERVER */
253256

254257
if (stream->iso == NULL || stream->iso->iso == NULL) {
255258
return -ENOTCONN;

subsys/bluetooth/audio/unicast_client.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ static void unicast_client_ep_iso_disconnected(struct bt_iso_chan *chan,
113113
struct bt_audio_ep *ep = EP_ISO(chan);
114114
struct bt_audio_stream *stream = ep->stream;
115115
struct bt_audio_stream_ops *ops = stream->ops;
116-
int err;
117116

118117
BT_DBG("stream %p ep %p reason 0x%02x", chan, ep, reason);
119118

@@ -124,11 +123,6 @@ static void unicast_client_ep_iso_disconnected(struct bt_iso_chan *chan,
124123
}
125124

126125
bt_unicast_client_ep_set_state(ep, BT_AUDIO_EP_STATE_QOS_CONFIGURED);
127-
128-
err = bt_audio_stream_iso_listen(stream);
129-
if (err != 0) {
130-
BT_ERR("Could not make stream listen: %d", err);
131-
}
132126
}
133127

134128
static struct bt_iso_chan_ops unicast_client_iso_ops = {

0 commit comments

Comments
 (0)