123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #! /bin/sh
- set -e
- DESC="bluetooth"
- NAME=bluetoothd
- DAEMON=/usr/sbin/$NAME
- echo 483 > /sys/class/gpio/export
- echo out > /sys/class/gpio/gpio483/direction
- echo 0 > /sys/class/gpio/gpio483/value
- sleep 1
- echo 1 > /sys/class/gpio/gpio483/value
- case "$1" in
- start)
- printf "Starting $DESC: "
- start-stop-daemon -S -b -x $NAME
- #brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 115200 --patchram /etc/firmware/bcm4343b0.hcd /dev/ttyS2 & >/dev/null
- #hciconfig hci0 up
- if [ `dmesg | grep -c 'BCM43430/1'` -gt 0 ]; then
- brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 115200 --patchram /etc/firmware/bcm43430a1.hcd /dev/ttyS1 &
- fi
- if [ `dmesg | grep -c 'BCM43430/2'` -gt 0 ]; then
- brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 115200 --patchram /etc/firmware/bcm4343b0.hcd /dev/ttyS1 &
- fi
- echo "OK"
- ;;
- stop)
- printf "Stopping $DESC: "
- start-stop-daemon -K -x $NAME
- echo "OK"
- ;;
- restart|force-reload)
- echo "Restarting $DESC: "
- $0 stop
- sleep 1
- $0 start
- echo ""
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|force-reload}" >&2
- exit 1
- ;;
- esac
- exit 0
|