Bluetooth: shell: Fix available contexts value
This fixes the available audio contexts that shall be a subset of
supported audio contexts.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
diff --git a/subsys/bluetooth/shell/audio.c b/subsys/bluetooth/shell/audio.c
index 26fd5c1..a3ddc32 100644
--- a/subsys/bluetooth/shell/audio.c
+++ b/subsys/bluetooth/shell/audio.c
@@ -1421,11 +1421,14 @@
#endif /* CONFIG_BT_AUDIO_UNICAST || CONFIG_BT_AUDIO_BROADCAST_SOURCE */
if (IS_ENABLED(CONFIG_BT_AUDIO_CAPABILITY)) {
- /* Mark all supported contexts as available */
- bt_audio_capability_set_available_contexts(BT_AUDIO_DIR_SINK,
- BT_AUDIO_CONTEXT_TYPE_ANY);
- bt_audio_capability_set_available_contexts(BT_AUDIO_DIR_SOURCE,
- BT_AUDIO_CONTEXT_TYPE_ANY);
+ /* Mark mandatory context as available */
+ err = bt_audio_capability_set_available_contexts(
+ BT_AUDIO_DIR_SINK, BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED);
+ __ASSERT(err == 0, "Failed to set sink available contexts");
+
+ err = bt_audio_capability_set_available_contexts(
+ BT_AUDIO_DIR_SOURCE, BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED);
+ __ASSERT(err == 0, "Failed to set source available contexts");
}
#if defined(CONFIG_BT_AUDIO_UNICAST)