1#!/usr/bin/env bash
2# Copyright 2025 Nordic Semiconductor ASA
3# SPDX-License-Identifier: Apache-2.0
4
5# Smoketest for CSIP BTP commands with the BT tester
6
7simulation_id="tester_csip"
8verbosity_level=2
9EXECUTE_TIMEOUT=100
10
11source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
12
13cd ${BSIM_OUT_PATH}/bin
14
15UART_DIR=/tmp/bs_${USER}/${simulation_id}/
16UART_PER=${UART_DIR}/peripheral
17UART_CEN=${UART_DIR}/central
18
19# Central BT Tester
20Execute ./bs_${BOARD_TS}_tests_bluetooth_tester_le_audio_prj_conf \
21  -v=${verbosity_level} -s=${simulation_id} -rs=10 -d=0 -RealEncryption=1 \
22  -uart0_fifob_rxfile=${UART_CEN}.tx -uart0_fifob_txfile=${UART_CEN}.rx
23
24# Central Upper Tester
25Execute ./bs_nrf52_bsim_native_tests_bsim_bluetooth_tester_prj_conf \
26  -v=${verbosity_level} -s=${simulation_id} -rs=21 -d=10 -RealEncryption=1 -testid=csip_central \
27  -nosim -uart0_fifob_rxfile=${UART_CEN}.rx -uart0_fifob_txfile=${UART_CEN}.tx
28
29# Peripheral BT Tester
30Execute ./bs_${BOARD_TS}_tests_bluetooth_tester_le_audio_prj_conf \
31  -v=${verbosity_level} -s=${simulation_id} -rs=32 -d=1 -RealEncryption=1 \
32  -uart0_fifob_rxfile=${UART_PER}.tx -uart0_fifob_txfile=${UART_PER}.rx
33
34# Peripheral Upper Tester
35Execute ./bs_nrf52_bsim_native_tests_bsim_bluetooth_tester_prj_conf \
36  -v=${verbosity_level} -s=${simulation_id} -rs=43 -d=11 -RealEncryption=1 -testid=csip_peripheral \
37  -nosim -uart0_fifob_rxfile=${UART_PER}.rx -uart0_fifob_txfile=${UART_PER}.tx
38
39Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} -D=2 -sim_length=20e6 $@
40
41wait_for_background_jobs # Wait for all programs in background and return != 0 if any fails
42