Skip to content

Instantly share code, notes, and snippets.

@Nokius
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nokius/916af8424af38a15bfcd to your computer and use it in GitHub Desktop.
Save Nokius/916af8424af38a15bfcd to your computer and use it in GitHub Desktop.
/usr/bin/droid/droid-hcismd-up.sh
#!/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