1#!/usr/bin/env bash
2#
3# Copyright (c) 2021 Nordic Semiconductor ASA
4#
5# SPDX-License-Identifier: Apache-2.0
6
7source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
8
9SIMULATION_ID="media_controller"
10VERBOSITY_LEVEL=2
11
12cd ${BSIM_OUT_PATH}/bin
13
14printf "\n\n======== Running media controller local_player test =========\n\n"
15
16Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf \
17  -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=media_controller_local_player \
18  -RealEncryption=1 -rs=23 -D=1
19
20# Simulation time should be larger than the WAIT_TIME in common.h
21Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
22  -D=1 -sim_length=60e6 $@
23
24wait_for_background_jobs
25
26printf "\n\n======== Running media controller remote_player test =========\n\n"
27
28Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf \
29  -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=media_controller_remote_player \
30  -RealEncryption=1 -rs=46 -D=2
31
32Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf \
33  -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=1 -testid=media_controller_server \
34  -RealEncryption=1 -rs=23 -D=2
35
36# Simulation time should be larger than the WAIT_TIME in common.h
37Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
38  -D=2 -sim_length=60e6 $@
39
40wait_for_background_jobs
41