1Bluetooth: Basic Audio Profile: Scan Delegator Shell
2####################################################
3
4This document describes how to run the Scan Delegator functionality, Note that
5in the examples below, some lines of debug have been
6removed to make this shorter and provide a better overview.
7
8The Scan Delegator may optionally support the periodic advertisements
9synchronization transfer (PAST) protocol.
10
11The Scan Delegator server typically resides on devices that have inputs or
12outputs.
13
14It is necessary to have
15:kconfig:option:`CONFIG_BT_BAP_SCAN_DELEGATOR_LOG_LEVEL_DBG` enabled for using
16the Scan Delegator interactively.
17
18The Scan Delegator can currently only set the sync state of a receive state, but
19does not actually support syncing with periodic advertisements yet.
20
21.. code-block:: console
22
23   bap_scan_delegator --help
24   bap_scan_delegator - Bluetooth BAP Scan Delegator shell commands
25   Subcommands:
26     init                : Initialize the service and register callbacks
27     set_past_pref       : Set PAST preference <true || false>
28     sync_pa             : Sync to PA <src_id>
29     term_pa             : Terminate PA sync <src_id>
30     add_src             : Add a PA as source <addr> <sid> <broadcast_id>
31                          <enc_state> [bis_sync [metadata]]
32     add_src_by_pa_sync  : Add a PA as source <broadcast_id> <enc_state> [bis_sync
33                          [metadata]]
34     mod_src             : Modify source <src_id> <broadcast_id> <enc_state>
35                          [bis_sync [metadata]]
36     rem_src             : Remove source <src_id>
37     synced              : Set server scan state <src_id> <bis_syncs>
38
39
40
41
42Example Usage
43*************
44
45Setup
46=====
47
48.. code-block:: console
49
50   uart:~$ bt init
51   uart:~$ bap_scan_delegator init
52   uart:~$ bt advertise on
53   Advertising started
54
55Adding a source
56===============
57
58.. code-block:: console
59
60   uart:~$ bap_scan_delegator add_src 11:22:33:44:55:66 public 0 1234 0
61   Receive state with ID 0 updated
62
63Adding a source from a PA sync
64==============================
65
66.. code-block:: console
67
68   uart:~$ bt scan on
69   Found broadcaster with ID 0x681A22 and addr 2C:44:05:82:EB:82 (random) and sid 0x00 (looking for 0x1000000)
70   uart:~$ bt scan off
71   uart:~$ bt per-adv-sync-create 2C:44:05:82:EB:82 (random) 0
72   PA 0x2003e9b0 synced
73   uart:~$ bap_scan_delegator add_src_by_pa_sync 0x681A22 0
74   Receive state with ID 0 updated
75
76When connected
77==============
78
79Set sync state for a source:
80
81.. code-block:: console
82
83   uart:~$ bap_scan_delegator synced 0 1 3 0
84