Bluetooth: BAP: Scan delegator add src without PA sync

Modify the bt_bap_scan_delegator_add_src to take an address and
a sid instead of a PA sync object, so that the scan delegator
can add a source without syncing to the PA.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2024-06-21 15:52:10 +02:00 committed by Anas Nashif
commit 38d09af445
6 changed files with 215 additions and 38 deletions

View file

@ -23,8 +23,20 @@ does not actually support syncing with periodic advertisements yet.
bap_scan_delegator --help
bap_scan_delegator - Bluetooth BAP Scan Delegator shell commands
Subcommands:
init :Initialize the service and register callbacks
synced :Set server scan state <src_id> <pa_synced> <bis_syncs> <enc_state>
init : Initialize the service and register callbacks
set_past_pref : Set PAST preference <true || false>
sync_pa : Sync to PA <src_id>
term_pa : Terminate PA sync <src_id>
add_src : Add a PA as source <addr> <sid> <broadcast_id>
<enc_state> [bis_sync [metadata]]
add_src_by_pa_sync : Add a PA as source <broadcast_id> <enc_state> [bis_sync
[metadata]]
mod_src : Modify source <src_id> <broadcast_id> <enc_state>
[bis_sync [metadata]]
rem_src : Remove source <src_id>
synced : Set server scan state <src_id> <bis_syncs>
Example Usage
@ -36,9 +48,31 @@ Setup
.. code-block:: console
uart:~$ bt init
uart:~$ bap_scan_delegator init
uart:~$ bt advertise on
Advertising started
Adding a source
===============
.. code-block:: console
uart:~$ bap_scan_delegator add_src 11:22:33:44:55:66 public 0 1234 0
Receive state with ID 0 updated
Adding a source from a PA sync
==============================
.. code-block:: console
uart:~$ bt scan on
Found broadcaster with ID 0x681A22 and addr 2C:44:05:82:EB:82 (random) and sid 0x00 (looking for 0x1000000)
uart:~$ bt scan off
uart:~$ bt per-adv-sync-create 2C:44:05:82:EB:82 (random) 0
PA 0x2003e9b0 synced
uart:~$ bap_scan_delegator add_src_by_pa_sync 0x681A22 0
Receive state with ID 0 updated
When connected
==============