-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples: Add Broadcast Assistant sample
First version of Broadcast Assistant sample with hard coded selection of sink and source. Signed-off-by: Lars Knudsen <[email protected]>
- Loading branch information
Showing
6 changed files
with
640 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
samples/bluetooth/broadcast_audio_assistant/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
cmake_minimum_required(VERSION 3.20.0) | ||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
project(broadcast_audio_assistant) | ||
|
||
target_sources(app PRIVATE | ||
src/main.c | ||
) | ||
|
||
zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (c) 2024 Demant A/S | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
mainmenu "Bluetooth: Broadcast Audio Assistant" | ||
|
||
config SELECT_SOURCE_NAME | ||
string "Selected Broadcast Source name" | ||
default "" | ||
help | ||
Name of broadcast source device to select. This will be used as a | ||
substring matched against both BT device name and broadcast name. | ||
If empty, the first broadcast source found will be chosen. | ||
Matching is not case sensitive. | ||
|
||
config SELECT_SINK_NAME | ||
string "Selected Broadcast Sink name" | ||
default "" | ||
help | ||
Name of broadcast sink device to select. This will be used as a | ||
substring matched against the BT device name. | ||
If empty, the first broadcast sink found will be chosen. | ||
Matching is not case sensitive. | ||
|
||
source "Kconfig.zephyr" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
.. zephyr:code-sample:: bluetooth_broadcast_audio_assistant | ||
:name: Bluetooth: Broadcast Audio Assistant | ||
:relevant-api: bt_bap | ||
|
||
Use LE Audio Broadcast Assistant functionality | ||
|
||
Overview | ||
******** | ||
|
||
Application demonstrating the LE Audio broadcast assistant functionality. | ||
|
||
The sample will automatically try to connect to a device in the BAP Scan Delegator | ||
role (advertising support for the Broadcast Audio Scan Service (BASS)). | ||
It will then search for a broadcast source and (if found) add the broadcast ID to | ||
the BAP Scan Delegator. | ||
|
||
Practical use of this sample requires a sink (e.g. the Broadcast Audio Sink sample or | ||
a set of LE Audio Broadcast capable earbuds) and a source (e.g. the Broadcast Audio | ||
Source sample). | ||
|
||
This sample can be found under | ||
:zephyr_file:`samples/bluetooth/broadcast_audio_assistant` in the Zephyr tree. | ||
|
||
Check the :ref:`bluetooth samples section <bluetooth-samples>` for general information. | ||
|
||
Requirements | ||
************ | ||
|
||
* BlueZ running on the host, or | ||
* A board with Bluetooth Low Energy 5.2 support | ||
* Broadcast Audio Source and Sink devices | ||
|
||
Building and Running | ||
******************** | ||
|
||
The application will act as a broadcast assistant with optionally preconfigured | ||
filtering of broadcast sink and broadcast source names. By default, the application will | ||
search for and connect to the first broadcast audio sink found (advertising PACS and | ||
BASS UUIDs) and then search for and select the first broadcast audio source found | ||
(advertising a broadcast ID). | ||
|
||
Filter these by modifying the following configs: | ||
|
||
``CONFIG_SELECT_SINK_NAME``: Substring of BT name of the sink. | ||
|
||
and | ||
|
||
``CONFIG_SELECT_SOURCE_NAME``: Substring of BT name or broadcast name of the source. | ||
|
||
Building for an nrf52840dk | ||
-------------------------- | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/bluetooth/broadcast_audio_assistant/ | ||
:board: nrf52840dk_nrf52840 | ||
:goals: build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CONFIG_BT=y | ||
CONFIG_LOG=y | ||
CONFIG_BT_CENTRAL=y | ||
CONFIG_BT_AUDIO=y | ||
CONFIG_BT_SMP=y | ||
CONFIG_BT_BONDABLE=n | ||
CONFIG_BT_BUF_ACL_RX_SIZE=255 | ||
CONFIG_BT_BUF_ACL_TX_SIZE=251 | ||
CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 | ||
|
||
CONFIG_BT_TINYCRYPT_ECC=y | ||
|
||
CONFIG_BT_EXT_ADV=y | ||
CONFIG_BT_BAP_BROADCAST_ASSISTANT=y | ||
|
||
# CONFIG_BT_BAP_SCAN_DELEGATOR=y is required until the following | ||
# bug is fixed: https:/zephyrproject-rtos/zephyr/issues/68338 | ||
CONFIG_BT_BAP_SCAN_DELEGATOR=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
sample: | ||
description: Bluetooth Low Energy Broadcast Assistant sample | ||
name: Bluetooth Low Energy Broadcast Assistant sample | ||
tests: | ||
sample.bluetooth.broadcast_audio_assistant: | ||
harness: bluetooth | ||
platform_allow: | ||
- nrf52840dk_nrf52840 | ||
integration_platforms: | ||
- nrf52840dk_nrf52840 | ||
tags: bluetooth |
Oops, something went wrong.