File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
samples/bluetooth/unicast_audio_server/src Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -599,6 +599,37 @@ static int set_location(void)
599
599
return 0 ;
600
600
}
601
601
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
+
602
633
static int set_available_contexts (void )
603
634
{
604
635
int err ;
@@ -652,6 +683,11 @@ void main(void)
652
683
return ;
653
684
}
654
685
686
+ err = set_supported_contexts ();
687
+ if (err != 0 ) {
688
+ return ;
689
+ }
690
+
655
691
err = set_available_contexts ();
656
692
if (err != 0 ) {
657
693
return ;
You can’t perform that action at this time.
0 commit comments