Modify the wearable's stack up script
[platform/core/connectivity/bluetooth-tools.git] / scripts / wearable / bt-stack-up.sh
1 #!/bin/sh
2 PATH=/bin:/usr/bin:/sbin:/usr/sbin
3
4 RFKILL=/usr/sbin/rfkill
5 GREP=/usr/bin/grep
6 HFP_HF=hfp_hf
7
8 echo "Check for bcm43012 device - TW2"
9 if (${RFKILL} list | ${GREP} bcm43012); then
10         echo "Solis TW2 device"
11         HFP_AG=hfp_ag
12 fi
13
14 if [ $HFP_HF ]
15 then
16 /usr/bin/bluetooth-hf-agent &
17 fi
18
19 if [ $HFP_AG ]
20 then
21 /usr/bin/bluetooth-ag-agent &
22 fi
23
24 #
25 # Script for executing Bluetooth stack
26 #
27
28 # Register BT Device
29 /usr/etc/bluetooth/bt-dev-start.sh
30
31 if !(/usr/bin/hciconfig | grep hci); then
32         echo "Registering BT device is failed."
33         exit 1
34 fi
35
36 exit 0