samples: Bluetooth: Unicast audio server: Add missing supported contexts
Add missing calls to setting supported contexts. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
2cc1fe259a
commit
4db60883db
1 changed files with 36 additions and 0 deletions
|
@ -599,6 +599,37 @@ static int set_location(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int set_supported_contexts(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_PAC_SNK)) {
|
||||
err = bt_pacs_set_supported_contexts(BT_AUDIO_DIR_SINK,
|
||||
AVAILABLE_SINK_CONTEXT);
|
||||
if (err != 0) {
|
||||
printk("Failed to set sink supported contexts (err %d)\n",
|
||||
err);
|
||||
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_PAC_SRC)) {
|
||||
err = bt_pacs_set_supported_contexts(BT_AUDIO_DIR_SOURCE,
|
||||
AVAILABLE_SOURCE_CONTEXT);
|
||||
if (err != 0) {
|
||||
printk("Failed to set source supported contexts (err %d)\n",
|
||||
err);
|
||||
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
printk("Supported contexts successfully set\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_available_contexts(void)
|
||||
{
|
||||
int err;
|
||||
|
@ -652,6 +683,11 @@ void main(void)
|
|||
return;
|
||||
}
|
||||
|
||||
err = set_supported_contexts();
|
||||
if (err != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
err = set_available_contexts();
|
||||
if (err != 0) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue