-
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
7 changed files
with
496 additions
and
0 deletions.
There are no files selected for viewing
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_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 Assistant" | ||
|
||
config SELECT_SOURCE_NAME | ||
string "Selected Broadcast Source name" | ||
default "Broadcast Audio Source" | ||
help | ||
Name of broadcast source device to select. This will be used as a | ||
substring match 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 "Broadcast Audio Sink" | ||
help | ||
Name of broadcast sink device to select. This will be used as a | ||
substring match 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,50 @@ | ||
.. zephyr:code-sample:: bluetooth_broadcast_assistant | ||
:name: Bluetooth: Broadcast Assistant | ||
:relevant-api: bt_bap | ||
|
||
Bluetooth: Broadcast Assistant | ||
|
||
Overview | ||
******** | ||
|
||
Application demonstrating the LE Audio broadcast assistant functionality. | ||
|
||
The sample will automatically try to connect to the Broadcast Audio Scan Service (BASS) | ||
on a preconfigured broadcast sink. It will then search for a specific broadcast source and | ||
(if found) add the broadcast ID to the BASS. | ||
|
||
This sample can be found under | ||
:zephyr_file:`samples/bluetooth/broadcast_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 | ||
|
||
Building and Running | ||
******************** | ||
|
||
The application will act as a Broadcast Assistant with preconfigured selection | ||
of Broadcast Sink and Broadcast Source names. By default, the application will | ||
search for the bluetooth audio sink (:zephyr_file:`samples/bluetooth/broadcast_audio_sink`) | ||
and bluetooth audio source (:zephyr_file:`samples/bluetooth/broadcast_audio_source`) samples | ||
with their respective default names. | ||
|
||
Customize this 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_assistant/ | ||
:board: nrf52840dk_nrf52840 | ||
:goals: build |
1 change: 1 addition & 0 deletions
1
samples/bluetooth/broadcast_assistant/boards/nrf52840dk_nrf52840.conf
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 @@ | ||
CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 |
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,12 @@ | ||
CONFIG_BT=y | ||
CONFIG_LOG=y | ||
CONFIG_BT_CENTRAL=y | ||
CONFIG_BT_AUDIO=y | ||
CONFIG_BT_SMP=y | ||
CONFIG_BT_BUF_ACL_RX_SIZE=255 | ||
CONFIG_BT_BUF_ACL_TX_SIZE=251 | ||
|
||
CONFIG_BT_TINYCRYPT_ECC=y | ||
|
||
CONFIG_BT_EXT_ADV=y | ||
CONFIG_BT_BAP_BROADCAST_ASSISTANT=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_assistant: | ||
harness: bluetooth | ||
platform_allow: | ||
- nrf52840dk_nrf52840 | ||
integration_platforms: | ||
- nrf52840dk_nrf52840 | ||
tags: bluetooth |
Oops, something went wrong.