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