-
-
Save Nokius/916af8424af38a15bfcd to your computer and use it in GitHub Desktop.
/usr/bin/droid/droid-hcismd-up.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Maximum number of attempts to enable hcismd to try to get | |
# hci0 to come online. Writing to sysfs too early seems to | |
# not work, so we loop. | |
MAXTRIES=15 | |
seq 1 $MAXTRIES | while read i ; do | |
echo 1 > /sys/module/hci_smd/parameters/hcismd_set | |
if [ -e /sys/class/bluetooth/hci0 ] ; then | |
# found hci0, exit successfully | |
exit 0 | |
fi | |
sleep 1 | |
if [ $i == $MAXTRIES ] ; then | |
# must have gotten through all our retries, fail | |
exit 1 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment