#!/bin/sh
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
# Script for registering BT device
BT_PLATFORM_DEFAULT_HCI_NAME="Tizen"
-# Trun-on Bluetooth Chip
+# Turn-on Bluetooth Chip
/usr/sbin/rfkill unblock bluetooth
echo "Check for Bluetooth device status"
-if (/usr/sbin/hciconfig | grep hci); then
+if (/usr/bin/hciconfig | grep hci); then
echo "Bluetooth device is UP"
- /usr/sbin/hciconfig hci0 up
+ /usr/bin/hciconfig hci0 up
else
echo "Bluetooth device is DOWN"
echo "Registering Bluetooth device"
- /usr/sbin/hciconfig hci0 up
- /usr/sbin/hciconfig hci0 name $BT_PLATFORM_DEFAULT_HCI_NAME
- /usr/sbin/hciconfig hci0 sspmode 1
+ /usr/bin/hciconfig hci0 up
+ /usr/bin/hciconfig hci0 name $BT_PLATFORM_DEFAULT_HCI_NAME
+ if [ -e "/usr/lib/bt-plugin-headed.so" ]; then
+ echo "Bluetooth headed device"
+ /usr/bin/hciconfig hci0 sspmode 1
+ else
+ echo "Bluetooth headless device"
+ /usr/bin/hciconfig hci0 sspmode 0
+ fi
fi