1#!/usr/bin/env bash
2# Copyright 2023 Nordic Semiconductor ASA
3# SPDX-License-Identifier: Apache-2.0
4
5set -eu
6source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
7
8verbosity_level=2
9simulation_id="host_privacy_peripheral"
10EXECUTE_TIMEOUT=240
11
12central_exe="${BSIM_OUT_PATH}/bin/bs_${BOARD_TS}_$(guess_test_long_name)_prj_conf"
13peripheral_exe="${central_exe}"
14
15cd ${BSIM_OUT_PATH}/bin
16
17Execute "$central_exe" \
18    -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central -RealEncryption=1 \
19    -flash="${simulation_id}.central.log.bin" -flash_erase
20
21Execute "$peripheral_exe" \
22    -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral -RealEncryption=1 \
23    -flash="${simulation_id}.peripheral.log.bin" -flash_erase
24
25Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
26    -D=2 -sim_length=70e6 $@
27
28wait_for_background_jobs
29
30Execute "$central_exe" \
31    -v=${verbosity_level} -s=${simulation_id}.2 -d=0 -testid=central -RealEncryption=1 \
32    -flash="${simulation_id}.central.log.bin" -flash_rm
33
34Execute "$peripheral_exe" \
35    -v=${verbosity_level} -s=${simulation_id}.2 -d=1 -testid=peripheral -RealEncryption=1 \
36    -flash="${simulation_id}.peripheral.log.bin" -flash_rm
37
38Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id}.2 \
39    -D=2 -sim_length=70e6 $@
40
41wait_for_background_jobs
42