From 1b54a4ab87a2c772c897772df39c8818e02ee120 Mon Sep 17 00:00:00 2001 From: Sebastian Apel Date: Wed, 13 Jan 2021 22:04:46 +0100 Subject: [PATCH] Bugfix: get bluetoothlctl info to work when more than one device is present Feature: add avinfo and hciconfig information --- src/tools/pw-gather-bluetooth-debug-info.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/tools/pw-gather-bluetooth-debug-info.sh b/src/tools/pw-gather-bluetooth-debug-info.sh index 14e443638..c6df30636 100755 --- a/src/tools/pw-gather-bluetooth-debug-info.sh +++ b/src/tools/pw-gather-bluetooth-debug-info.sh @@ -2,12 +2,19 @@ LOGNAME=bt-debuginfo-$(date +%Y%m%d-%H%M%S).txt -echo "-------- cat /proc/versionus" >> "/tmp/$LOGNAME" +echo "-------- cat /proc/version" >> "/tmp/$LOGNAME" cat /proc/version > "/tmp/$LOGNAME" echo "-------- lsusb -v 2>&1 | egrep 'bDeviceProtocol(.*)Bluetooth' -B7 | head -1 " >> "/tmp/$LOGNAME" lsusb -v 2>&1 | egrep 'bDeviceProtocol(.*)Bluetooth' -B7 | head -1 >> "/tmp/$LOGNAME" +echo "-------- hciconfig" >> "/tmp/$LOGNAME" +hciconfig >> "/tmp/$LOGNAME" + +echo "-------- hciconfig hci0 features" >> "/tmp/$LOGNAME" +hciconfig hci0 features >> "/tmp/$LOGNAME" + + if [ "$(id -u)" = "0" ]; then echo "-------- cat /sys/kernel/debug/usb/devices" >> "/tmp/$LOGNAME" cat /sys/kernel/debug/usb/devices >> "/tmp/$LOGNAME" @@ -22,6 +29,15 @@ echo "-------- bluetoothctl devices" >> "/tmp/$LOGNAME" bluetoothctl devices >> "/tmp/$LOGNAME" echo "-------- bluetoothctl info" >> "/tmp/$LOGNAME" -bluetoothctl info >> "/tmp/$LOGNAME" +bluetoothctl devices | awk '{ print $2 }' | xargs -n 1 bluetoothctl info >> "/tmp/$LOGNAME" + +# avinfo is not installed on every system +echo "-------- avinfo codec information" >> "/tmp/$LOGNAME" +AVINFO=$(which avinfo) +if [ "$AVINFO" = "" ]; then + echo "avinfo not found - probably not installed on system" >> "/tmp/$LOGNAME" +else + bluetoothctl devices | awk '{ print $2 }' | xargs -n 1 "$AVINFO" +fi echo "Information on your bluetooth setup collected into /tmp/$LOGNAME"