Skip to content

Instantly share code, notes, and snippets.

@Nokius

Nokius/gist:916af8424af38a15bfcd Secret

Last active Aug 29, 2015
Embed
What would you like to do?
/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
You can’t perform that action at this time.