%cmake \
%if "%{?tizen_profile_name}" == "wearable"
-DTIZEN_WEARABLE=YES \
-%elseif "%{?tizen_profile_name}" == "mobile"
+%else
+%if "%{?tizen_profile_name}" == "mobile" || "%{?tizen_profile_name}" == "tv"
-DTIZEN_WEARABLE=NO \
%endif
+%endif
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
make %{?jobs:-j%jobs}
%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-hci-logdump.sh
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-run-hcidump.sh
%{_datadir}/license/bluetooth-tools
INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-edutm-mode-on.sh DESTINATION etc/bluetooth)
INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-edutm-off.sh DESTINATION etc/bluetooth)
INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-hci-logdump.sh DESTINATION etc/bluetooth)
+INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-run-hcidump.sh DESTINATION etc/bluetooth)
#
HCIDUMP_ENABLE="true" # Available values : true | false (default : false)
-HCIDUMP_DIR="/opt/usr/media/.bluetooth"
+HCIDUMP_DIR="/opt/usr/media/.bt_dump"
HCIDUMP_FILENAME="bt_hcidump.log"
HCIDUMP_PATH="${HCIDUMP_DIR}/${HCIDUMP_FILENAME}"
LOGDUMP_DIR="/opt/etc/dump.d/module.d"
BLUETOOTH_DEBUG=${1}/bluetooth
PREV_PWD=${PWD}
-BT_DUMP_DIR=/opt/usr/media/.bluetooth
+BT_DUMP_DIR=/opt/usr/media/Others/.bt_dump
if [ ! -e ${BT_DUMP_DIR} ]
then
exit 0
fi
-mkdir -p ${BLUETOOTH_DEBUG}
+/bin/mkdir -p ${BLUETOOTH_DEBUG}
cd ${BT_DUMP_DIR}
/bin/tar -cvzf ${BLUETOOTH_DEBUG}/bt_dump.tar.gz *
--- /dev/null
+#!/bin/sh
+
+HCIDUMP_BASEDIR="/opt/usr/media/Others"
+HCIDUMP_DIR="${HCIDUMP_BASEDIR}/.bt_dump"
+HCIDUMP_FILENAME="bt_hcidump.log"
+HCIDUMP_PATH="${HCIDUMP_DIR}/${HCIDUMP_FILENAME}"
+
+LOGDUMP_DIR="/opt/etc/dump.d/module.d"
+LOGDUMP_PATH="${LOGDUMP_DIR}/bt-hci-logdump.sh"
+
+debug_mode=`/bin/cat /sys/module/sec_debug/parameters/enable`
+debug_mode_user=`/bin/cat /sys/module/sec_debug/parameters/enable_user`
+
+if [ ${debug_mode} = '1' -o ${debug_mode_user} = '1' ]
+then
+ if [ -e /usr/sbin/hcidump ]
+ then
+ # When *#9900# is typed, this is executed to archive logs.
+ /bin/mkdir -p ${LOGDUMP_DIR}
+ /bin/cp -f /usr/etc/bluetooth/bt-hci-logdump.sh ${LOGDUMP_PATH}
+
+ # Create base directory as proper owner and smack rule
+ # if it doesn't exist
+ if [ ! -e ${HCIDUMP_BASEDIR} ]
+ then
+ /bin/mkdir - p ${HCIDUMP_BASEDIR}
+ /bin/chown 5000:5000 ${HCIDUMP_BASEDIR}
+ /usr/bin/chsmack -t -a 'system::media' ${HCIDUMP_BASEDIR}
+ fi
+ /bin/mkdir -p ${HCIDUMP_DIR}/old_hcidump
+ /bin/rm -f ${HCIDUMP_DIR}/old_hcidump/*
+ /bin/mv ${HCIDUMP_PATH}* ${HCIDUMP_DIR}/old_hcidump/
+ /usr/sbin/hcidump -w ${HCIDUMP_PATH} &
+ fi
+elif [ -e ${HCIDUMP_DIR} ]
+then
+ /bin/rm -rf ${HCIDUMP_DIR}
+fi
# Initialize BT vconf values
vconftool set -tf int db/bluetooth/status "0" -g 6520
+vconftool set -tf int db/bluetooth/lestatus "0" -g 6520
vconftool set -tf int file/private/bt-core/flight_mode_deactivated "0" -g 6520 -i
vconftool set -tf string memory/bluetooth/sco_headset_name "" -g 6520 -i
vconftool set -tf int memory/bluetooth/device "0" -g 6520 -i
-vconftool set -tf int memory/bluetooth/btsco "0" -g 6520 -i
vconftool set -tf int file/private/libug-setting-bluetooth-efl/visibility_time "0" -g 6520
-vconftool set -tf bool memory/private/bluetooth-share/quickpanel_clear_btn_status FALSE -g 6520 -i
-vconftool set -tf bool memory/private/bluetooth-share/opp_server_init FALSE -g 6520 -i
+#vconftool set -tf bool memory/private/bluetooth-share/quickpanel_clear_btn_status FALSE -g 6520 -i
+#vconftool set -tf bool memory/private/bluetooth-share/opp_server_init FALSE -g 6520 -i
# Remove BT shared memory
list=`ipcs -m | awk '$1==0x0001000 {print $2}'`
# Script for stopping Bluetooth stack
#
+PGREP="/usr/bin/pgrep"
+
# Remove BT device
/usr/etc/bluetooth/bt-dev-end.sh
# Kill BlueZ bluetooth stack
-killall obexd obex-client
-killall bt-syspopup
-killall bluetooth-share
-killall bluetooth-pb-agent
-killall bluetooth-map-agent
-killall bluetooth-hfp-agent
-killall bluetoothd
+pid=`${PGREP} obexd`
+kill $pid
+pid=`${PGREP} bt-syspopup`
+kill $pid
+pid=`${PGREP} bluetooth-pb`
+kill $pid
+pid=`${PGREP} bluetooth-map`
+kill $pid
+pid=`${PGREP} bluetooth-ag`
+kill $pid
+pid=`${PGREP} bluetoothd`
+kill $pid
# result
exit 0
vconftool set -tf int file/private/bt-core/flight_mode_deactivated "0" -g 6520 -i
vconftool set -tf string memory/bluetooth/sco_headset_name "" -g 6520 -i
vconftool set -tf int memory/bluetooth/device "0" -g 6520 -i
-vconftool set -tf int memory/bluetooth/btsco "0" -g 6520 -i
vconftool set -tf int file/private/libug-setting-bluetooth-efl/visibility_time "0" -g 6520
vconftool set -tf bool memory/private/bluetooth-share/quickpanel_clear_btn_status FALSE -g 6520 -i
vconftool set -tf bool memory/private/bluetooth-share/opp_server_init FALSE -g 6520 -i
# Script for stopping Bluetooth stack
#
+PGREP="/usr/bin/pgrep"
+
# Remove BT device
/usr/etc/bluetooth/bt-dev-end.sh
# Kill BlueZ bluetooth stack
-killall bluetooth
-killall obexd obex-client
-killall bluetooth-share
-killall bluetooth-pb-agent
-killall bluetooth-map-agent
-killall bluetooth-hfp-agent
-killall bluetooth-hf-agent
-killall bluetoothd
+pid=`${PGREP} bt-syspopup`
+kill $pid
+pid=`${PGREP} bluetooth-hf`
+kill $pid
+pid=`${PGREP} bluetooth-ag`
+kill $pid
+pid=`${PGREP} bluetoothd`
+kill $pid
# result
exit 0