a0e513aa3e01f1569d8fa3217805b0e6f85ea261
[platform/core/connectivity/bluetooth-tools.git] / scripts / bt-dev-start.sh
1 #!/bin/sh
2
3 # Script for registering BT device
4 BT_PLATFORM_DEFAULT_HCI_NAME="Tizen"
5
6 # Turn-on Bluetooth Chip
7
8 /usr/sbin/rfkill unblock bluetooth
9
10 echo "Check for Bluetooth device status"
11 if (/usr/bin/hciconfig | grep hci); then
12         echo "Bluetooth device is UP"
13         /usr/bin/hciconfig hci0 up
14 else
15         echo "Bluetooth device is DOWN"
16         echo "Registering Bluetooth device"
17         /usr/bin/hciconfig hci0 up
18         /usr/bin/hciconfig hci0 name $BT_PLATFORM_DEFAULT_HCI_NAME
19         /usr/bin/hciconfig hci0 sspmode 1
20 fi