8c2f49b26b4ba911dd07471580d8947a48458890
[platform/core/connectivity/bluetooth-tools.git] / scripts / bt-edutm-dev-up.sh
1 #!/bin/sh
2
3 #
4 # Script for turning on Bluetooth (EDUTM)
5 #
6
7 if /usr/sbin/hciconfig | grep hci; then
8         /usr/etc/bluetooth/bt-stack-down.sh
9         sleep 1
10 fi
11
12 # Register BT Device
13 /usr/etc/bluetooth/bt-dev-start.sh
14
15 if !(/usr/sbin/hciconfig | grep hci); then
16         echo "BT EDUTM failed. Registering BT device is failed."
17         exit 1
18 fi
19
20 # Execute BlueZ BT stack
21 echo "Run bluetoothd"
22 /usr/sbin/bluetoothd
23 /usr/bin/bt-service &
24 sleep 0.1
25
26 /usr/sbin/hciconfig hci0 name TIZEN-Mobile
27
28 /usr/sbin/hciconfig hci0 piscan
29
30 if [ -e "/sys/devices/hci0/idle_timeout" ]
31 then
32         echo "Set idle time"
33         echo 0> /sys/devices/hci0/idle_timeout
34 fi