2 PATH=/bin:/usr/bin:/sbin:/usr/sbin
5 # Script for turning on Bluetooth EDUTM
8 HCIDUMP_ENABLE="true" # Available values : true | false (default : false)
9 HCIDUMP_DIR="/opt/usr/media/.bt_dump"
10 HCIDUMP_FILENAME="bt_hcidump.log"
11 HCIDUMP_PATH="${HCIDUMP_DIR}/${HCIDUMP_FILENAME}"
12 LOGDUMP_DIR="/opt/etc/dump.d/module.d"
13 LOGDUMP_PATH="${LOGDUMP_DIR}/bt-hci-logdump.sh"
16 /usr/etc/bluetooth/bt-dev-start.sh
18 if !(/usr/bin/hciconfig | /bin/grep hci); then
19 echo "BT EDUTM failed. Registering BT device is failed."
23 if [ -e /usr/sbin/hcidump -a ${HCIDUMP_ENABLE} = "true" ]
25 # When *#9900# is typed, this is executed to archive logs. #
26 /bin/mkdir -p ${LOGDUMP_DIR}
27 /bin/cp -f /usr/etc/bluetooth/bt-hci-logdump.sh ${LOGDUMP_PATH}
29 /bin/mkdir -p ${HCIDUMP_DIR}/old_hcidump
30 # /bin/rm -f ${HCIDUMP_DIR}/old_hcidump/*
31 /bin/mv ${HCIDUMP_PATH}* ${HCIDUMP_DIR}/old_hcidump/
32 /usr/sbin/hcidump -w ${HCIDUMP_PATH}_`date +%s_%N` & # You can get unique file name.
33 # /usr/sbin/hcidump -w ${HCIDUMP_PATH} &
36 echo "Configure BT device"
37 /usr/bin/hcitool cmd 0x3 0x0005 0x02 0x00 0x02
39 echo "Send BT edutm command"
40 /usr/bin/hcitool cmd 0x06 0x0003
42 # Execute BlueZ BT stack
44 /usr/lib/bluetooth/bluetoothd &
48 /usr/bin/hciconfig hci0 name TIZEN-Mobile
50 /usr/bin/hciconfig hci0 piscan
52 if [ -e "/sys/devices/hci0/idle_timeout" ]
55 echo 0 > /sys/devices/hci0/idle_timeout
58 if [ -e /usr/etc/bluetooth/TIInit_* ]
61 /usr/bin/hcitool cmd 0x3 0xFD0C