@@ -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 )
8281static 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+
8587static 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
154157bool 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
236239int 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 ;
0 commit comments