hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
while [ 1 ]
do
        if ! pidof gatt-service; then
                break
        fi
        sleep 1
done
 
if pidof bluetoothd; then
        killall bluetoothd
fi
if pidof bluealsa; then
        killall bluealsa
fi
 
sleep 1
case "$1" in
        0)
       hciconfig hci0 down
       ;;
   1)
       /usr/libexec/bluetooth/bluetoothd --compat -n &
            sdptool add A2SNK
            sleep 2
            hciconfig hci0 up
            sleep 1
            hciconfig hci0 piscan
            sleep 1
            hciconfig hci0 class 0x240404
            hciconfig hci0 down
            hciconfig hci0 up
            bluealsa --profile=a2dp-sink &
            sleep 1
            bluealsa-aplay --profile-a2dp 00:00:00:00:00:00 &
       ;;
   *)
esac
exit 0