S90bluetooth 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #! /bin/sh
  2. set -e
  3. DESC="bluetooth"
  4. NAME=bluetoothd
  5. DAEMON=/usr/sbin/$NAME
  6. echo 483 > /sys/class/gpio/export
  7. echo out > /sys/class/gpio/gpio483/direction
  8. echo 0 > /sys/class/gpio/gpio483/value
  9. sleep 1
  10. echo 1 > /sys/class/gpio/gpio483/value
  11. case "$1" in
  12. start)
  13. printf "Starting $DESC: "
  14. start-stop-daemon -S -b -x $NAME
  15. #brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 115200 --patchram /etc/firmware/bcm4343b0.hcd /dev/ttyS2 & >/dev/null
  16. #hciconfig hci0 up
  17. if [ `dmesg | grep -c 'BCM43430/1'` -gt 0 ]; then
  18. brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 115200 --patchram /etc/firmware/bcm43430a1.hcd /dev/ttyS1 &
  19. fi
  20. if [ `dmesg | grep -c 'BCM43430/2'` -gt 0 ]; then
  21. brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 115200 --patchram /etc/firmware/bcm4343b0.hcd /dev/ttyS1 &
  22. fi
  23. echo "OK"
  24. ;;
  25. stop)
  26. printf "Stopping $DESC: "
  27. start-stop-daemon -K -x $NAME
  28. echo "OK"
  29. ;;
  30. restart|force-reload)
  31. echo "Restarting $DESC: "
  32. $0 stop
  33. sleep 1
  34. $0 start
  35. echo ""
  36. ;;
  37. *)
  38. echo "Usage: $0 {start|stop|restart|force-reload}" >&2
  39. exit 1
  40. ;;
  41. esac
  42. exit 0