4 # Script for turning on Bluetooth EDUTM
7 HCIDUMP_ENABLE="true" # Available values : true | false (default : false)
8 HCIDUMP_DIR="/opt/usr/media/.bt_dump"
9 HCIDUMP_FILENAME="bt_hcidump.log"
10 HCIDUMP_PATH="${HCIDUMP_DIR}/${HCIDUMP_FILENAME}"
11 LOGDUMP_DIR="/opt/etc/dump.d/module.d"
12 LOGDUMP_PATH="${LOGDUMP_DIR}/bt-hci-logdump.sh"
15 /usr/etc/bluetooth/bt-dev-start.sh
17 if !(/usr/bin/hciconfig | /bin/grep hci); then
18 echo "BT EDUTM failed. Registering BT device is failed."
22 if [ -e /usr/sbin/hcidump -a ${HCIDUMP_ENABLE} = "true" ]
24 # When *#9900# is typed, this is executed to archive logs. #
25 /bin/mkdir -p ${LOGDUMP_DIR}
26 /bin/cp -f /usr/etc/bluetooth/bt-hci-logdump.sh ${LOGDUMP_PATH}
28 /bin/mkdir -p ${HCIDUMP_DIR}/old_hcidump
29 # /bin/rm -f ${HCIDUMP_DIR}/old_hcidump/*
30 /bin/mv ${HCIDUMP_PATH}* ${HCIDUMP_DIR}/old_hcidump/
31 /usr/sbin/hcidump -w ${HCIDUMP_PATH}_`date +%s_%N` & # You can get unique file name.
32 # /usr/sbin/hcidump -w ${HCIDUMP_PATH} &
35 echo "Configure BT device"
36 /usr/bin/hcitool cmd 0x3 0x0005 0x02 0x00 0x02
38 echo "Send BT edutm command"
39 /usr/bin/hcitool cmd 0x06 0x0003
41 # Execute BlueZ BT stack
43 /usr/lib/bluetooth/bluetoothd &
47 /usr/bin/hciconfig hci0 name TIZEN-Mobile
49 /usr/bin/hciconfig hci0 piscan
51 if [ -e "/sys/devices/hci0/idle_timeout" ]
54 echo 0 > /sys/devices/hci0/idle_timeout
57 if [ -e /usr/etc/bluetooth/TIInit_* ]
60 /usr/bin/hcitool cmd 0x3 0xFD0C