2 PATH=/bin:/usr/bin:/sbin:/usr/sbin
5 # Script for stopping Broadcom UART Bluetooth stack
11 /usr/bin/hciconfig hci0 down
13 # Turn off Bluetooth Chip
14 /usr/sbin/rfkill block bluetooth
16 #/usr/bin/killall hciattach
17 # Do NOT use killall due to smack
18 hciattach_pid=`${PGREP} hciattach`
21 HCI_CONFIG=/usr/bin/hciconfig
23 for ((i=1; i<=$TIMEOUT; i++))
26 if [ $i -eq $TIMEOUT ]
28 echo "time expired happen $i"
31 if (${HCI_CONFIG} | grep DOWN); then
32 echo "Bluetooth device is down"
35 if (${HCI_CONFIG} | grep hci); then
36 echo "Bluetooth device still exist"