* Use double quote to prevent globbing and exit with error in case directory doesn't exit in hassos-hook.sh * echo flags are undefined in POSIX, use bash instead in bluetooth-rtl8723
22 lines
577 B
Bash
Executable File
22 lines
577 B
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "Setup the Bluetooth chip"
|
|
echo 146 > /sys/class/gpio/export
|
|
echo 149 > /sys/class/gpio/export
|
|
echo 151 > /sys/class/gpio/export
|
|
echo high > /sys/class/gpio/gpio146/direction
|
|
echo high > /sys/class/gpio/gpio149/direction
|
|
echo high > /sys/class/gpio/gpio151/direction
|
|
|
|
|
|
echo "Resetting the Bluetooth chip"
|
|
echo 0 > /sys/class/gpio/gpio149/value
|
|
echo -e "\tBluetooth chip power down..."
|
|
sleep 1
|
|
echo 1 > /sys/class/gpio/gpio149/value
|
|
echo -e "\tBluetooth chip power up..."
|
|
sleep 1
|
|
echo -e "\tResetting done"
|
|
|
|
/usr/sbin/rtk_hciattach -s 115200 /dev/ttyS0 rtk_h5
|