3 HCIDUMP_DIR="/opt/usr/media/.bluetooth"
4 HCIDUMP_FILENAME="bt_hcidump.log"
5 HCIDUMP_PATH="${HCIDUMP_DIR}/${HCIDUMP_FILENAME}"
6 LOGDUMP_DIR="/opt/etc/dump.d/module.d"
7 LOGDUMP_PATH="${LOGDUMP_DIR}/bt-hci-logdump.sh"
9 /usr/bin/bluetooth-hf-agent &
11 # Script for executing Bluetooth stack
15 /usr/etc/bluetooth/bt-dev-start.sh
17 if !(/usr/bin/hciconfig | grep hci); then
18 echo "Registering BT device is failed."
22 debug_mode=`cat /sys/module/sec_debug/parameters/enable`
23 debug_mode_user=`cat /sys/module/sec_debug/parameters/enable_user`
25 if [ ${debug_mode} = '1' -o ${debug_mode_user} = '1' ]
27 if [ -e /usr/sbin/hcidump ]
29 # When *#9900# is typed, this is executed to archive logs. #
30 /bin/mkdir -p ${LOGDUMP_DIR}
31 /bin/cp -f /usr/etc/bluetooth/bt-hci-logdump.sh ${LOGDUMP_PATH}
33 /bin/mkdir -p ${HCIDUMP_DIR}/old_hcidump
34 /bin/rm -f ${HCIDUMP_DIR}/old_hcidump/*
35 /bin/mv ${HCIDUMP_PATH}* ${HCIDUMP_DIR}/old_hcidump/
36 /usr/sbin/hcidump -w ${HCIDUMP_PATH} &
38 elif [ -e ${HCIDUMP_DIR} ]
40 /bin/rm -rf ${HCIDUMP_DIR}
43 # Execute BlueZ BT stack
45 /usr/lib/bluetooth/bluetoothd -d -C &
46 /usr/bin/dbus-send --print-reply --system --type=method_call \
47 --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 \
48 org.freedesktop.systemd1.Manager.StartUnit \
49 string:'wms.service' string:'fail'