Code sync: merged tizen 2.4 base source code
[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/bin/hciconfig | /bin/grep hci; then
8         /usr/etc/bluetooth/bt-stack-down.sh
9         /bin/sleep 1
10 fi
11
12 # Register BT Device
13 /usr/etc/bluetooth/bt-dev-start.sh
14
15 if !(/usr/bin/hciconfig | /bin/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/lib/bluetooth/bluetoothd &
23 /usr/bin/bt-service &
24 /bin/sleep 0.1
25
26 /usr/bin/hciconfig hci0 name TIZEN-Mobile
27
28 /usr/bin/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