Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- gpio_start()
- {
- echo 10 > /sys/class/gpio/export
- if [ -d /sys/class/gpio/gpio10 ]
- then
- echo out > /sys/class/gpio/gpio10/direction
- echo 0 > /sys/class/gpio/gpio10/value
- echo 1 > /sys/class/gpio/gpio10/value
- echo "GPIO OK"
- else
- echo "GPIO error"
- fi
- return 0
- }
- modprobe bluetooth
- modprobe hci_uart
- modprobe bnep
- modprobe rfcomm
- if [ -f "/lib/firmware/ap6212/bcm43438a0.hcd" ]
- then
- mkdir -p /etc/firmware/ap6212
- cp /lib/firmware/ap6212/bcm43438a0.hcd /etc/firmware/ap6212/4343A0.hcd
- fi
- PORT="ttyS1"
- if [ @? ]
- then
- btattach -B /dev/$PORT &
- sleep 0.5
- rfcomm
- /usr/libexec/bluetooth/bluetoothd -d &
- fi
- /usr/sbin/rfkill "unblock" "all"
- if [ @? ]
- then
- echo "BT unlocked"
- devmem2 0x1f00060 b 1
- gpio_start
- sleep 0.5
- if [ -n $(hciconfig hci0 up) ]
- then
- echo "Bluetooth ready"
- return 0
- else
- echo "Error bluetooth"
- return 1
- fi
- else
- echo "BT locked"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement