2024-04-26 21:35:24 +08:00
|
|
|
.. zephyr:code-sample:: bluetooth_cap_initiator
|
2024-09-06 19:42:27 +08:00
|
|
|
:name: Common Audio Profile (CAP) Initiator
|
|
|
|
:relevant-api: bluetooth bt_bap bt_cap bt_conn
|
2024-04-26 21:35:24 +08:00
|
|
|
|
2024-08-29 23:32:37 +08:00
|
|
|
Connect to CAP Acceptors and setup unicast audio streaming or broadcast audio streams.
|
2024-04-26 21:35:24 +08:00
|
|
|
|
|
|
|
Overview
|
|
|
|
********
|
|
|
|
|
|
|
|
Application demonstrating the CAP Initiator functionality.
|
2024-05-06 21:29:46 +08:00
|
|
|
Starts by either scanning for a CAP Acceptor and then connects to and sets up available unicast
|
|
|
|
audio streams, sets up a broadcast audio stream, or both.
|
2024-04-26 21:35:24 +08:00
|
|
|
|
|
|
|
This sample can be found under :zephyr_file:`samples/bluetooth/cap_initiator` in the Zephyr tree.
|
|
|
|
|
2024-09-16 16:55:34 +08:00
|
|
|
Check the :zephyr:code-sample-category:`bluetooth` samples for general information.
|
2024-04-26 21:35:24 +08:00
|
|
|
|
|
|
|
Requirements
|
|
|
|
************
|
|
|
|
|
|
|
|
* BlueZ running on the host, or
|
|
|
|
* A board with Bluetooth Low Energy 5.2 support
|
|
|
|
|
|
|
|
Building and Running
|
|
|
|
********************
|
|
|
|
|
|
|
|
When building targeting an nrf52 series board with the Zephyr Bluetooth Controller,
|
2024-10-17 17:28:15 +08:00
|
|
|
use ``-DEXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf`` to enable the required ISO
|
2024-04-26 21:35:24 +08:00
|
|
|
feature support.
|
|
|
|
|
|
|
|
Building for an nrf5340dk
|
|
|
|
-------------------------
|
|
|
|
|
|
|
|
You can build both the application core image and an appropriate controller image for the network
|
|
|
|
core with:
|
|
|
|
|
|
|
|
.. zephyr-app-commands::
|
|
|
|
:zephyr-app: samples/bluetooth/cap_initiator/
|
|
|
|
:board: nrf5340dk/nrf5340/cpuapp
|
|
|
|
:goals: build
|
|
|
|
:west-args: --sysbuild
|
|
|
|
|
|
|
|
If you prefer to only build the application core image, you can do so by doing instead:
|
|
|
|
|
|
|
|
.. zephyr-app-commands::
|
|
|
|
:zephyr-app: samples/bluetooth/cap_initiator/
|
|
|
|
:board: nrf5340dk/nrf5340/cpuapp
|
|
|
|
:goals: build
|
|
|
|
|
|
|
|
In that case you can pair this application core image with the
|
2024-08-29 23:32:37 +08:00
|
|
|
:zephyr:code-sample:`bluetooth_hci_ipc` sample
|
2024-04-26 21:35:24 +08:00
|
|
|
:zephyr_file:`samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf` configuration.
|
|
|
|
|
|
|
|
Building for a simulated nrf5340bsim
|
|
|
|
------------------------------------
|
|
|
|
|
|
|
|
Similarly to how you would for real HW, you can do:
|
|
|
|
|
|
|
|
.. zephyr-app-commands::
|
|
|
|
:zephyr-app: samples/bluetooth/cap_initiator/
|
|
|
|
:board: nrf5340bsim/nrf5340/cpuapp
|
|
|
|
:goals: build
|
|
|
|
:west-args: --sysbuild
|
|
|
|
|
2024-09-11 01:51:57 +08:00
|
|
|
Note this will produce a Linux executable in :file:`./build/zephyr/zephyr.exe`.
|
2024-04-26 21:35:24 +08:00
|
|
|
For more information, check :ref:`this board documentation <nrf5340bsim>`.
|
|
|
|
|
|
|
|
Building for a simulated nrf52_bsim
|
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
.. zephyr-app-commands::
|
|
|
|
:zephyr-app: samples/bluetooth/cap_initiator/
|
|
|
|
:board: nrf52_bsim
|
|
|
|
:goals: build
|
2024-10-17 17:28:15 +08:00
|
|
|
:gen-args: -DEXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf
|