2 PATH=/bin:/usr/bin:/sbin:/usr/sbin
4 HCIDUMP_DIR="/opt/usr/media/.bluetooth"
5 HCIDUMP_FILENAME="bt_hcidump.log"
6 HCIDUMP_PATH="${HCIDUMP_DIR}/${HCIDUMP_FILENAME}"
7 LOGDUMP_DIR="/opt/etc/dump.d/module.d"
8 LOGDUMP_PATH="${LOGDUMP_DIR}/bt-hci-logdump.sh"
9 RFKILL=/usr/sbin/rfkill
13 echo "Check for bcm43012 device - TM2"
14 if (${RFKILL} list | ${GREP} bcm43012); then
15 echo "Solis TM2 device"
21 /usr/bin/bluetooth-hf-agent &
26 /usr/bin/bluetooth-ag-agent &
30 # Script for executing Bluetooth stack
34 /usr/etc/bluetooth/bt-dev-start.sh
36 if !(/usr/bin/hciconfig | grep hci); then
37 echo "Registering BT device is failed."
41 debug_mode=`cat /sys/module/sec_debug/parameters/enable`
42 debug_mode_user=`cat /sys/module/sec_debug/parameters/enable_user`
44 if [ ${debug_mode} = '1' -o ${debug_mode_user} = '1' ]
46 if [ -e /usr/sbin/hcidump ]
48 # When *#9900# is typed, this is executed to archive logs. #
49 /bin/mkdir -p ${LOGDUMP_DIR}
50 /bin/cp -f /usr/etc/bluetooth/bt-hci-logdump.sh ${LOGDUMP_PATH}
52 /bin/mkdir -p ${HCIDUMP_DIR}/old_hcidump
53 /bin/rm -f ${HCIDUMP_DIR}/old_hcidump/*
54 /bin/mv ${HCIDUMP_PATH}* ${HCIDUMP_DIR}/old_hcidump/
55 /usr/sbin/hcidump -w ${HCIDUMP_PATH} &
57 elif [ -e ${HCIDUMP_DIR} ]
59 /bin/rm -rf ${HCIDUMP_DIR}
62 # Execute BlueZ BT stack
64 /usr/libexec/bluetooth/bluetoothd -d -C &
65 /usr/bin/dbus-send --print-reply --system --type=method_call \
66 --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 \
67 org.freedesktop.systemd1.Manager.StartUnit \
68 string:'wms.service' string:'fail'