Skip to content

Commit d779de1

Browse files
ulfalizerandrewboie
authored andcommitted
bt_sim: basic_conn_encrypted.sh: Use lowercase for internal vars
This makes it possible to tell at a glance which variables are internal to the script and which ones are parameters to it, which is very helpful. This convention is pretty common. See e.g. Google's shell style guide at https://google.github.io/styleguide/shell.xml#Naming_Conventions, and https://github.com/icy/bash-coding-style#naming-and-styles. It's older than those though. Signed-off-by: Ulf Magnusson <[email protected]>
1 parent 0d8495c commit d779de1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/bluetooth/bsim_bt/bsim_test_app/tests_scripts/basic_conn_encrypted.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
# Basic connection test: a central connects to a peripheral and expects a
66
# notification
7-
SIMULATION_ID="basic_conn_encr"
8-
VERBOSITY_LEVEL=2
9-
PROCESS_IDS=""; EXIT_CODE=0
7+
simulation_id="basic_conn_encr"
8+
verbosity_level=2
9+
process_ids=""; exit_code=0
1010

1111
function Execute(){
1212
if [ ! -f $1 ]; then
1313
echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\
1414
compile it?)\e[39m"
1515
exit 1
1616
fi
17-
timeout 5 $@ & PROCESS_IDS="$PROCESS_IDS $!"
17+
timeout 5 $@ & process_ids="$process_ids $!"
1818
}
1919

2020
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
@@ -25,17 +25,17 @@ BOARD="${BOARD:-nrf52_bsim}"
2525
cd ${BSIM_OUT_PATH}/bin
2626

2727
Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_app_prj_conf \
28-
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -RealEncryption=1 \
28+
-v=${verbosity_level} -s=${simulation_id} -d=0 -RealEncryption=1 \
2929
-testid=peripheral -rs=23
3030

3131
Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_app_prj_conf \
32-
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=1 -RealEncryption=1 \
32+
-v=${verbosity_level} -s=${simulation_id} -d=1 -RealEncryption=1 \
3333
-testid=central_encrypted -rs=6
3434

35-
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
35+
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
3636
-D=2 -sim_length=20e6 $@
3737

38-
for PROCESS_ID in $PROCESS_IDS; do
39-
wait $PROCESS_ID || let "EXIT_CODE=$?"
38+
for process_id in $process_ids; do
39+
wait $process_id || let "exit_code=$?"
4040
done
41-
exit $EXIT_CODE #the last exit code != 0
41+
exit $exit_code #the last exit code != 0

0 commit comments

Comments
 (0)