1#!/usr/bin/env bash
2# Copyright 2023 Nordic Semiconductor ASA
3# SPDX-License-Identifier: Apache-2.0
4
5#set -x #uncomment this line for debugging
6set -ue
7
8: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root directory}"
9
10source ${ZEPHYR_BASE}/tests/bsim/compile.source
11
12if [ "${BOARD_TS}" == "nrf5340bsim_nrf5340_cpuapp" ]; then
13  app=tests/bsim/bluetooth/audio_samples/cap/initiator \
14    sample=${ZEPHYR_BASE}/samples/bluetooth/cap_initiator \
15    cmake_extra_args="-DCONFIG_SAMPLE_UNICAST=n" \
16    conf_file=${sample}/prj.conf \
17    conf_overlay=${sample}/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf \
18    exe_name=bs_${BOARD_TS}_${app}_broadcast_prj_conf sysbuild=1 compile
19  app=tests/bsim/bluetooth/audio_samples/cap/acceptor \
20    sample=${ZEPHYR_BASE}/samples/bluetooth/cap_acceptor \
21    cmake_extra_args="-DCONFIG_SAMPLE_SCAN_SELF=y -DCONFIG_SAMPLE_UNICAST=n" \
22    conf_file=${sample}/prj.conf \
23    conf_overlay=${sample}/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf \
24    exe_name=bs_${BOARD_TS}_${app}_broadcast_prj_conf sysbuild=1 compile
25  app=tests/bsim/bluetooth/audio_samples/cap/initiator \
26    sample=${ZEPHYR_BASE}/samples/bluetooth/cap_initiator \
27    conf_file=${sample}/prj.conf \
28    conf_overlay=${sample}/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf \
29    exe_name=bs_${BOARD_TS}_${app}_unicast_prj_conf sysbuild=1 compile
30  app=tests/bsim/bluetooth/audio_samples/cap/acceptor \
31    sample=${ZEPHYR_BASE}/samples/bluetooth/cap_acceptor \
32    conf_file=${sample}/prj.conf \
33    conf_overlay=${sample}/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf \
34    exe_name=bs_${BOARD_TS}_${app}_unicast_prj_conf sysbuild=1 compile
35else
36  app=tests/bsim/bluetooth/audio_samples/cap/initiator \
37    sample=${ZEPHYR_BASE}/samples/bluetooth/cap_initiator \
38    cmake_extra_args="-DCONFIG_SAMPLE_UNICAST=n" \
39    conf_file=${sample}/prj.conf \
40    conf_overlay=${sample}/overlay-bt_ll_sw_split.conf \
41    exe_name=bs_${BOARD_TS}_${app}_broadcast_prj_conf sysbuild=1 compile
42  app=tests/bsim/bluetooth/audio_samples/cap/acceptor \
43    sample=${ZEPHYR_BASE}/samples/bluetooth/cap_acceptor \
44    cmake_extra_args="-DCONFIG_SAMPLE_SCAN_SELF=y -DCONFIG_SAMPLE_UNICAST=n" \
45    conf_file=${sample}/prj.conf \
46    conf_overlay=${sample}/overlay-bt_ll_sw_split.conf \
47    exe_name=bs_${BOARD_TS}_${app}_broadcast_prj_conf sysbuild=1 compile
48  app=tests/bsim/bluetooth/audio_samples/cap/initiator \
49    sample=${ZEPHYR_BASE}/samples/bluetooth/cap_initiator \
50    conf_file=${sample}/prj.conf \
51    conf_overlay=${sample}/overlay-bt_ll_sw_split.conf \
52    exe_name=bs_${BOARD_TS}_${app}_unicast_prj_conf sysbuild=1 compile
53  app=tests/bsim/bluetooth/audio_samples/cap/acceptor \
54    sample=${ZEPHYR_BASE}/samples/bluetooth/cap_acceptor \
55    conf_file=${sample}/prj.conf \
56    conf_overlay=${sample}/overlay-bt_ll_sw_split.conf \
57    exe_name=bs_${BOARD_TS}_${app}_unicast_prj_conf sysbuild=1 compile
58fi
59
60wait_for_background_jobs
61