Skip to content

Commit 4db6088

Browse files
Thalleycarlescufi
authored andcommitted
samples: Bluetooth: Unicast audio server: Add missing supported contexts
Add missing calls to setting supported contexts. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 2cc1fe2 commit 4db6088

File tree

1 file changed

+36
-0
lines changed
  • samples/bluetooth/unicast_audio_server/src

1 file changed

+36
-0
lines changed

samples/bluetooth/unicast_audio_server/src/main.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,37 @@ static int set_location(void)
599599
return 0;
600600
}
601601

602+
static int set_supported_contexts(void)
603+
{
604+
int err;
605+
606+
if (IS_ENABLED(CONFIG_BT_PAC_SNK)) {
607+
err = bt_pacs_set_supported_contexts(BT_AUDIO_DIR_SINK,
608+
AVAILABLE_SINK_CONTEXT);
609+
if (err != 0) {
610+
printk("Failed to set sink supported contexts (err %d)\n",
611+
err);
612+
613+
return err;
614+
}
615+
}
616+
617+
if (IS_ENABLED(CONFIG_BT_PAC_SRC)) {
618+
err = bt_pacs_set_supported_contexts(BT_AUDIO_DIR_SOURCE,
619+
AVAILABLE_SOURCE_CONTEXT);
620+
if (err != 0) {
621+
printk("Failed to set source supported contexts (err %d)\n",
622+
err);
623+
624+
return err;
625+
}
626+
}
627+
628+
printk("Supported contexts successfully set\n");
629+
630+
return 0;
631+
}
632+
602633
static int set_available_contexts(void)
603634
{
604635
int err;
@@ -652,6 +683,11 @@ void main(void)
652683
return;
653684
}
654685

686+
err = set_supported_contexts();
687+
if (err != 0) {
688+
return;
689+
}
690+
655691
err = set_available_contexts();
656692
if (err != 0) {
657693
return;

0 commit comments

Comments
 (0)