06-22-2023, 06:11 PM
IIRC Bluetooth comms setup sequence is as follows:
Trust
Pair
Connect
If the device is not trusted before pairing a passcode will be required. This would be indicated by a passcode prompt on the client trying to pair with the untrusted device.
In moOde /var/www/util/blu-control.sh script all scanned devices are automatically trusted for 90 secs.
Trust
Pair
Connect
If the device is not trusted before pairing a passcode will be required. This would be indicated by a passcode prompt on the client trying to pair with the untrusted device.
In moOde /var/www/util/blu-control.sh script all scanned devices are automatically trusted for 90 secs.
Code:
# Set to the value of the TemporaryTimeout param in /etc/bluetooth/main.conf
TRUSTED_DEVICE_TIMEOUT=90
.
.
.
# Trust scanned devices
TRUST() {
echo "** Trust expires in $TRUSTED_DEVICE_TIMEOUT seconds"
unset btdev
mapfile -t btdev < <(echo -e "devices\nquit" | bluetoothctl | grep "^Device" | while IFS= read -r line ; do echo "$line" |cut -d " " -f2- ; done )
for i in "${btdev[@]}" ; do
echo "** $i"
y="$( echo $i | cut -d " " -f1)"
echo -e "trust $y\nquit" | bluetoothctl >/dev/null
#sleep 1
done
echo "**"
}