Skip to content

Commit 17e8a48

Browse files
authored
Merge pull request #357 from smuppand/Bluetooth-fix
shellcheck: reduce false positives in Bluetooth scripts
2 parents 0772964 + fcef505 commit 17e8a48

2 files changed

Lines changed: 1 addition & 20 deletions

File tree

Runner/suites/Connectivity/Bluetooth/BT_SCAN_PAIR/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/sh
2-
32
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
43
# SPDX-License-Identifier: BSD-3-Clause
54
# Robustly find and source init_env
@@ -107,6 +106,7 @@ check_dependencies bluetoothctl rfkill expect hciconfig || {
107106
exit 0
108107
}
109108

109+
# shellcheck disable=SC2317 # cleanup is invoked via trap
110110
cleanup_bt_test() {
111111
# Cleanup only the primary MAC we worked with (if any)
112112
[ -n "$BT_MAC" ] && bt_cleanup_paired_device "$BT_MAC"

Runner/utils/lib_bluetooth.sh

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -85,25 +85,6 @@ retry_command_bt() {
8585
return 1
8686
}
8787

88-
# Check if a device (MAC or Name) is in the whitelist
89-
bt_in_whitelist() {
90-
device_name="$1"
91-
device_mac="$2"
92-
93-
whitelist_value="${WHITELIST:-}"
94-
log_info "Checking if MAC='$device_mac' or NAME='$device_name' is in whitelist: '$whitelist_value'"
95-
96-
echo "$whitelist_value" | tr -s ' ' '\n' | while IFS= read -r allowed; do
97-
if [ "$allowed" = "$device_mac" ] || [ "$allowed" = "$device_name" ]; then
98-
log_info "MAC or NAME matched and allowed: $allowed"
99-
return 0
100-
fi
101-
done
102-
103-
log_info "MAC matched but neither MAC nor NAME in whitelist"
104-
return 1
105-
}
106-
10788
# bt_parse_whitelist <whitelist_file>
10889
# Reads a whitelist file where each line has:
10990
bt_parse_whitelist() {

0 commit comments

Comments
 (0)