From 509709ef193849cefbcd4dc9f7720cb72a7613f0 Mon Sep 17 00:00:00 2001 From: "jk7744.park" Date: Tue, 8 Sep 2015 21:31:14 +0900 Subject: [PATCH] tizen 2.3.1 release --- LICENSE.APLv2 => LICENSE | 1 + NOTICE | 3 - NOTICE.APLv2.0 | 3 - bluetooth-tools.manifest | 15 ++--- debian/bluetooth-tools.install.in | 2 - debian/changelog | 95 --------------------------- debian/compat | 1 - debian/control | 18 ------ debian/rules | 115 --------------------------------- packaging/bluetooth-address.service | 15 ----- packaging/bluetooth-tools.spec | 36 +++++------ scripts/CMakeLists.txt | 17 +++-- scripts/bt-edutm-dev-up.sh | 16 ++--- scripts/bt-edutm-mode-on.sh | 8 +-- scripts/bt-edutm-off.sh | 2 +- scripts/bt-edutm-on.sh | 46 +++++++++---- scripts/bt-hci-logdump.sh | 21 ++++++ scripts/{ => mobile}/bluetooth-address | 0 scripts/{ => mobile}/bt-reset-env.sh | 2 +- scripts/{ => mobile}/bt-stack-down.sh | 1 - scripts/{ => mobile}/bt-stack-up.sh | 13 ++-- scripts/wearable/bt-reset-env.sh | 28 ++++++++ scripts/wearable/bt-stack-down.sh | 21 ++++++ scripts/wearable/bt-stack-up.sh | 51 +++++++++++++++ 24 files changed, 206 insertions(+), 324 deletions(-) rename LICENSE.APLv2 => LICENSE (99%) delete mode 100644 NOTICE delete mode 100644 NOTICE.APLv2.0 delete mode 100644 debian/bluetooth-tools.install.in delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100755 debian/rules delete mode 100644 packaging/bluetooth-address.service mode change 100644 => 100755 scripts/bt-edutm-dev-up.sh mode change 100644 => 100755 scripts/bt-edutm-on.sh create mode 100755 scripts/bt-hci-logdump.sh rename scripts/{ => mobile}/bluetooth-address (100%) rename scripts/{ => mobile}/bt-reset-env.sh (91%) rename scripts/{ => mobile}/bt-stack-down.sh (94%) mode change 100644 => 100755 rename scripts/{ => mobile}/bt-stack-up.sh (74%) mode change 100644 => 100755 create mode 100755 scripts/wearable/bt-reset-env.sh create mode 100755 scripts/wearable/bt-stack-down.sh create mode 100755 scripts/wearable/bt-stack-up.sh diff --git a/LICENSE.APLv2 b/LICENSE similarity index 99% rename from LICENSE.APLv2 rename to LICENSE index d645695..247c97d 100644 --- a/LICENSE.APLv2 +++ b/LICENSE @@ -1,3 +1,4 @@ +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. Apache License Version 2.0, January 2004 diff --git a/NOTICE b/NOTICE deleted file mode 100644 index 0e0f016..0000000 --- a/NOTICE +++ /dev/null @@ -1,3 +0,0 @@ -Copyright (c) Samsung Electronics Co., Ltd. All rights reserved. -Except as noted, this software is licensed under Apache License, Version 2. -Please, see the LICENSE.APLv2 file for Apache License terms and conditions. diff --git a/NOTICE.APLv2.0 b/NOTICE.APLv2.0 deleted file mode 100644 index ccdad52..0000000 --- a/NOTICE.APLv2.0 +++ /dev/null @@ -1,3 +0,0 @@ -Copyright (c) Samsung Electronics Co., Ltd. All rights reserved. -Except as noted, this software is licensed under Apache License, Version 2. -Please, see the LICENSE file for Apache License terms and conditions. diff --git a/bluetooth-tools.manifest b/bluetooth-tools.manifest index e9e71d9..ba9a10a 100644 --- a/bluetooth-tools.manifest +++ b/bluetooth-tools.manifest @@ -1,15 +1,8 @@ - - - - - - - - - - - + + + + diff --git a/debian/bluetooth-tools.install.in b/debian/bluetooth-tools.install.in deleted file mode 100644 index b498cd0..0000000 --- a/debian/bluetooth-tools.install.in +++ /dev/null @@ -1,2 +0,0 @@ -@PREFIX@/etc/bluetooth/* -/etc/rc.d/* diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 4a89341..0000000 --- a/debian/changelog +++ /dev/null @@ -1,95 +0,0 @@ -bluetooth-tools (0.2.35) precise; urgency=low - - * Synchronize the code with Private git - * Git: adaptation/devices/bluetooth-tools - * Tag: bluetooth-tools_0.2.35 - - -- Jaekyun Lee Fri, 07 Dec 2012 14:42:28 +0900 - -bluetooth-tools (0.2.32) unstable; urgency=low - - * Upload the package - * Git: slp/pkgs/b/bluetooth-tools - * Tag: bluetooth-tools_0.2.32 - - -- DoHyun Pyun Fri, 05 Oct 2012 15:04:50 +0900 - -bluetooth-tools (0.2.31) unstable; urgency=low - - * Upload the package - * Git: slp/pkgs/b/bluetooth-tools - * Tag: bluetooth-tools_0.2.31 - - -- DoHyun Pyun Wed, 26 Sep 2012 13:31:06 +0900 - -bluetooth-tools (0.2.30) unstable; urgency=low - - * Change SMACK domain name - * Git: slp/pkgs/b/bluetooth-tools - * Tag: bluetooth-tools_0.2.30 - - -- DoHyun Pyun Wed, 26 Sep 2012 08:45:53 +0900 - -bluetooth-tools (0.2.29) unstable; urgency=low - - * Change SMACK domain name - * Git: slp/pkgs/b/bluetooth-tools - * Tag: bluetooth-tools_0.2.29 - - -- Sangki Park Tue, 25 Sep 2012 10:35:52 +0900 - -bluetooth-tools (0.2.28) unstable; urgency=low - - * Upload the package - * Git: slp/pkgs/b/bluetooth-tools - * Tag: bluetooth-tools_0.2.28 - - -- Sangki Park Fri, 21 Sep 2012 09:06:54 +0900 - -bluetooth-tools (0.2.27) natty; urgency=low - - * Upload the package - * Git: slp/pkgs/b/bluetooth-tools - * Tag: bluetooth-tools_0.2.27 - - -- DoHyun Pyun Mon, 17 Sep 2012 10:56:45 +0900 - -bluetooth-tools (0.2.26) unstable; urgency=low - - * Upload the package - * Git: slp/pkgs/b/bluetooth-tools - * Tag: bluetooth-tools_0.2.26 - - -- Divya yadav Tue, 07 Aug 2012 12:48:23 +0530 - -bluetooth-tools (0.2.25) unstable; urgency=low - - * Upload the package - * Git: slp/pkgs/b/bluetooth-tools - * Tag: bluetooth-tools_0.2.25 - - -- DoHyun Pyun Wed, 23 May 2012 12:15:46 +0900 - -bluetooth-tools (0.2.24) unstable; urgency=low - - * Remove the code to launch the Obexd - * Git: slp/pkgs/b/bluetooth-tools - * Tag: bluetooth-tools_0.2.24 - - -- DoHyun Pyun Fri, 11 May 2012 09:42:39 +0900 - -bluetooth-tools (0.2.23) unstable; urgency=low - - * Changhe the basic FTP root folder - * Git: slp/pkgs/b/bluetooth-tools - * Tag: bluetooth-tools_0.2.23 - - -- DoHyun Pyun Tue, 08 May 2012 08:53:47 +0900 - -bluetooth-tools (0.2.22) unstable; urgency=low - - * split from bluetooth-dev-tools - * Git: slp/pkgs/b/bluetooth-tools - * Tag: bluetooth-tools_0.2.22 - - -- Jkyun Lee Mon, 05 Mar 2012 13:48:49 +0900 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 7ed6ff8..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/debian/control b/debian/control deleted file mode 100644 index 3705828..0000000 --- a/debian/control +++ /dev/null @@ -1,18 +0,0 @@ -Source: bluetooth-tools -Section: devel -Priority: optional -Maintainer: DoHyun Pyun , ChanYeol Park , Girish A J , InJun Yang , Jaekyun Lee -Uploaders: Sunil Behera , Syam Sidhardhan -Build-Depends: debhelper (>= 5), libglib2.0-dev, libdbus-glib-1-dev, libvconf-dev -Standards-Version: 3.7.2 -Homepage: N/A - -Package: bluetooth-tools -Architecture: any -Section: utils -Depends: ${shlibs:Depends}, ${misc:Depends} -Conflicts: bluetooth-dev-tool -Breaks: bluetooth-dev-tool -Replaces: bluetooth-dev-tool -Description: Tools and scripts for Bluetooth stack - Tools for Bluetooth diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 935af90..0000000 --- a/debian/rules +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/make -f - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -CFLAGS ?= -Wall -g -LDFLAGS ?= -PREFIX ?= /usr -DATADIR ?= /opt -PLUGIN_PREFIX ?= /usr - - -CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif - -LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - mkdir -p $(CMAKE_BUILD_DIR) && \ - cd $(CMAKE_BUILD_DIR) && \ - CFLAGS="$(CFLAGS) -fpie" LDFLAGS="$(LDFLAGS) -pie" \ - cmake .. -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DPLUGIN_INSTALL_PREFIX=$(PLUGIN_PREFIX) - - touch configure-stamp - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - - # Add here commands to compile the package. - cd $(CMAKE_BUILD_DIR) && $(MAKE) - - for f in `find $(CURDIR)/debian/ -name "*.in"`; do \ - cat $$f > $${f%.in}; \ - sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \ - sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \ - sed -i -e "s#@PLUGIN_PREFIX@#$(PLUGIN_PREFIX)#g" $${f%.in}; \ - done - - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - # Add here commands to clean up after the build process. - -rm -rf $(CMAKE_BUILD_DIR) - - for f in `find $(CURDIR)/debian/ -name "*.in"`; do \ - rm -f $${f%.in}; \ - done - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/wavplayer. - cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install - - # Booting script - mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc3.d - mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc5.d - ln -s ../init.d/bluetooth-address $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/S60bluetooth-address - ln -s ../init.d/bluetooth-address $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/S60bluetooth-address - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_installexamples - dh_install --sourcedir=debian/tmp -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_python -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link -# dh_strip --dbg-package=bluetooth-tools-dbg - dh_compress - dh_fixperms -# dh_perl - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/packaging/bluetooth-address.service b/packaging/bluetooth-address.service deleted file mode 100644 index a79a46c..0000000 --- a/packaging/bluetooth-address.service +++ /dev/null @@ -1,15 +0,0 @@ -# this Unit set Bluetooth Address, some application use the address although bluetooth doesn't turn on. -# especially, OSP API use it as such way. -# - -[Unit] -Description=Generate Bluetooth Address - -[Service] -Type=oneshot -ExecStart=/usr/etc/bluetooth/bt-set-addr.sh -RemainAfterExit=yes - -[Install] -WantedBy=bluetooth.target - diff --git a/packaging/bluetooth-tools.spec b/packaging/bluetooth-tools.spec index 6aebbae..7a4bfe8 100644 --- a/packaging/bluetooth-tools.spec +++ b/packaging/bluetooth-tools.spec @@ -1,16 +1,14 @@ Name: bluetooth-tools Summary: bluetooth-tools -Version: 0.2.35 -Release: 3 +Version: 0.2.45 +Release: 1 Group: TO_BE/FILLED_IN -License: Apache License, Version 2.0 +License: Apache-2.0 Source0: %{name}-%{version}.tar.gz -Source1001: bluetooth-address.service BuildRequires: cmake %description -Tools fo bluetooth run/stop and set address - +Tools fo bluetooth run/stop %prep %setup -q @@ -19,6 +17,17 @@ Tools fo bluetooth run/stop and set address export CFLAGS+=" -fpie -fvisibility=hidden" export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie" +%if "%{?tizen_profile_name}" == "wearable" +export CFLAGS="$CFLAGS -DTIZEN_WEARABLE" +%endif + +%cmake \ +%if "%{?tizen_profile_name}" == "wearable" + -DTIZEN_WEARABLE=YES \ +%elseif "%{?tizen_profile_name}" == "mobile" + -DTIZEN_WEARABLE=NO \ +%endif + cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} make %{?jobs:-j%jobs} @@ -28,20 +37,12 @@ rm -rf %{buildroot} mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d -ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address -ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address - -mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants -install -m 0644 %{SOURCE1001} %{buildroot}%{_libdir}/systemd/system/ -ln -s ../bluetooth-address.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/bluetooth-address.service +install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-tools %files %manifest bluetooth-tools.manifest %defattr(-,root,root,-) -%{_sysconfdir}/rc.d/init.d/bluetooth-address -%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address -%{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-stack-up.sh %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-stack-down.sh %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-reset-env.sh @@ -49,6 +50,5 @@ ln -s ../bluetooth-address.service %{buildroot}%{_libdir}/systemd/system/multi-u %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-dev-up.sh %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh -%{_libdir}/systemd/system/multi-user.target.wants/bluetooth-address.service -%{_libdir}/systemd/system/bluetooth-address.service - +%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-hci-logdump.sh +%{_datadir}/license/bluetooth-tools diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index a26f569..1e81a47 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,13 +1,18 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) # install script files -INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-stack-up.sh DESTINATION etc/bluetooth) -INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-stack-down.sh DESTINATION etc/bluetooth) -INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-reset-env.sh DESTINATION etc/bluetooth) + +IF (TIZEN_WEARABLE) +INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/wearable/bt-stack-up.sh DESTINATION etc/bluetooth) +INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/wearable/bt-stack-down.sh DESTINATION etc/bluetooth) +INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/wearable/bt-reset-env.sh DESTINATION etc/bluetooth) +ELSE () +INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/mobile/bt-stack-up.sh DESTINATION etc/bluetooth) +INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/mobile/bt-stack-down.sh DESTINATION etc/bluetooth) +INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/mobile/bt-reset-env.sh DESTINATION etc/bluetooth) +ENDIF (TIZEN_WEARABLE) INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-edutm-on.sh DESTINATION etc/bluetooth) INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-edutm-dev-up.sh DESTINATION etc/bluetooth) 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 booting script -INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-address DESTINATION /etc/rc.d/init.d) +INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-hci-logdump.sh DESTINATION etc/bluetooth) diff --git a/scripts/bt-edutm-dev-up.sh b/scripts/bt-edutm-dev-up.sh old mode 100644 new mode 100755 index 8c2f49b..a7b7c16 --- a/scripts/bt-edutm-dev-up.sh +++ b/scripts/bt-edutm-dev-up.sh @@ -4,31 +4,31 @@ # Script for turning on Bluetooth (EDUTM) # -if /usr/sbin/hciconfig | grep hci; then +if /usr/bin/hciconfig | /bin/grep hci; then /usr/etc/bluetooth/bt-stack-down.sh - sleep 1 + /bin/sleep 1 fi # Register BT Device /usr/etc/bluetooth/bt-dev-start.sh -if !(/usr/sbin/hciconfig | grep hci); then +if !(/usr/bin/hciconfig | /bin/grep hci); then echo "BT EDUTM failed. Registering BT device is failed." exit 1 fi # Execute BlueZ BT stack echo "Run bluetoothd" -/usr/sbin/bluetoothd +/usr/lib/bluetooth/bluetoothd & /usr/bin/bt-service & -sleep 0.1 +/bin/sleep 0.1 -/usr/sbin/hciconfig hci0 name TIZEN-Mobile +/usr/bin/hciconfig hci0 name TIZEN-Mobile -/usr/sbin/hciconfig hci0 piscan +/usr/bin/hciconfig hci0 piscan if [ -e "/sys/devices/hci0/idle_timeout" ] then echo "Set idle time" - echo 0> /sys/devices/hci0/idle_timeout + echo 0 > /sys/devices/hci0/idle_timeout fi diff --git a/scripts/bt-edutm-mode-on.sh b/scripts/bt-edutm-mode-on.sh index ae97221..8b12770 100755 --- a/scripts/bt-edutm-mode-on.sh +++ b/scripts/bt-edutm-mode-on.sh @@ -4,7 +4,7 @@ # Script for turning on EDUTM mode # -if /usr/sbin/hciconfig | grep hci; then +if /usr/bin/hciconfig | /bin/grep hci; then echo EDUTM already done, exit else echo Start EDUTM @@ -14,13 +14,13 @@ fi if [ -e /usr/etc/bluetooth/TIInit_* ] then echo "Reset device" - hcitool cmd 0x3 0xFD0C + /usr/bin/hcitool cmd 0x3 0xFD0C fi echo "Configure BT device" -hcitool cmd 0x3 0x0005 0x02 0x00 0x02 +/usr/bin/hcitool cmd 0x3 0x0005 0x02 0x00 0x02 echo "Send BT edutm command" -hcitool cmd 0x06 0x0003 +/usr/bin/hcitool cmd 0x06 0x0003 echo "BT edutm done" diff --git a/scripts/bt-edutm-off.sh b/scripts/bt-edutm-off.sh index d70d551..b0ae19b 100755 --- a/scripts/bt-edutm-off.sh +++ b/scripts/bt-edutm-off.sh @@ -5,7 +5,7 @@ # # Kill BlueZ bluetooth stack -killall bluetoothd +/usr/bin/killall bluetoothd # Remove BT device /usr/etc/bluetooth/bt-dev-end.sh diff --git a/scripts/bt-edutm-on.sh b/scripts/bt-edutm-on.sh old mode 100644 new mode 100755 index ff20d2c..2d88453 --- a/scripts/bt-edutm-on.sh +++ b/scripts/bt-edutm-on.sh @@ -4,42 +4,62 @@ # Script for turning on Bluetooth EDUTM # +HCIDUMP_ENABLE="true" # Available values : true | false (default : false) +HCIDUMP_DIR="/opt/usr/media/.bluetooth" +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" + # Register BT Device /usr/etc/bluetooth/bt-dev-start.sh -if !(/usr/sbin/hciconfig | grep hci); then +if !(/usr/bin/hciconfig | /bin/grep hci); then echo "BT EDUTM failed. Registering BT device is failed." exit 1 fi +if [ -e /usr/sbin/hcidump -a ${HCIDUMP_ENABLE} = "true" ] +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} + + /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}_`date +%s_%N` & # You can get unique file name. +# /usr/sbin/hcidump -w ${HCIDUMP_PATH} & +fi + +echo "Configure BT device" +/usr/bin/hcitool cmd 0x3 0x0005 0x02 0x00 0x02 + +echo "Send BT edutm command" +/usr/bin/hcitool cmd 0x06 0x0003 + # Execute BlueZ BT stack echo "Run bluetoothd" -/usr/sbin/bluetoothd +/usr/lib/bluetooth/bluetoothd & /usr/bin/bt-service & -sleep 0.1 +/bin/sleep 0.1 -/usr/sbin/hciconfig hci0 name TIZEN-Mobile +/usr/bin/hciconfig hci0 name TIZEN-Mobile -/usr/sbin/hciconfig hci0 piscan +/usr/bin/hciconfig hci0 piscan if [ -e "/sys/devices/hci0/idle_timeout" ] then echo "Set idle time" - echo 0> /sys/devices/hci0/idle_timeout + echo 0 > /sys/devices/hci0/idle_timeout fi if [ -e /usr/etc/bluetooth/TIInit_* ] then echo "Reset device" - hcitool cmd 0x3 0xFD0C + /usr/bin/hcitool cmd 0x3 0xFD0C fi -echo "Configure BT device" -hcitool cmd 0x3 0x0005 0x02 0x00 0x02 - -echo "Send BT edutm command" -hcitool cmd 0x06 0x0003 - echo "BT edutm done" # result diff --git a/scripts/bt-hci-logdump.sh b/scripts/bt-hci-logdump.sh new file mode 100755 index 0000000..88e3deb --- /dev/null +++ b/scripts/bt-hci-logdump.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +#-------------------------------------- +# bluetooth hci +#-------------------------------------- + +BLUETOOTH_DEBUG=${1}/bluetooth +PREV_PWD=${PWD} +BT_DUMP_DIR=/opt/usr/media/.bluetooth + +if [ ! -e ${BT_DUMP_DIR} ] +then + exit 0 +fi + +mkdir -p ${BLUETOOTH_DEBUG} + +cd ${BT_DUMP_DIR} +/bin/tar -cvzf ${BLUETOOTH_DEBUG}/bt_dump.tar.gz * + +cd ${PREV_PWD} diff --git a/scripts/bluetooth-address b/scripts/mobile/bluetooth-address similarity index 100% rename from scripts/bluetooth-address rename to scripts/mobile/bluetooth-address diff --git a/scripts/bt-reset-env.sh b/scripts/mobile/bt-reset-env.sh similarity index 91% rename from scripts/bt-reset-env.sh rename to scripts/mobile/bt-reset-env.sh index 4532357..535aa35 100755 --- a/scripts/bt-reset-env.sh +++ b/scripts/mobile/bt-reset-env.sh @@ -11,7 +11,7 @@ rm -rf /var/lib/bluetooth/* # Initialize BT vconf values vconftool set -tf int db/bluetooth/status "0" -g 6520 -vconftool set -tf int file/private/bt-service/flight_mode_deactivated "0" -g 6520 -i +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 diff --git a/scripts/bt-stack-down.sh b/scripts/mobile/bt-stack-down.sh old mode 100644 new mode 100755 similarity index 94% rename from scripts/bt-stack-down.sh rename to scripts/mobile/bt-stack-down.sh index 96b77fe..322241a --- a/scripts/bt-stack-down.sh +++ b/scripts/mobile/bt-stack-down.sh @@ -8,7 +8,6 @@ /usr/etc/bluetooth/bt-dev-end.sh # Kill BlueZ bluetooth stack -killall bluetooth killall obexd obex-client killall bt-syspopup killall bluetooth-share diff --git a/scripts/bt-stack-up.sh b/scripts/mobile/bt-stack-up.sh old mode 100644 new mode 100755 similarity index 74% rename from scripts/bt-stack-up.sh rename to scripts/mobile/bt-stack-up.sh index 4145556..0b4b302 --- a/scripts/bt-stack-up.sh +++ b/scripts/mobile/bt-stack-up.sh @@ -7,26 +7,21 @@ # Register BT Device /usr/etc/bluetooth/bt-dev-start.sh -if !(/usr/sbin/hciconfig | grep hci); then +if !(/usr/bin/hciconfig | grep hci); then echo "Registering BT device is failed." exit 1 fi -# Execute BlueZ BT stack -echo "Run bluetoothd" - # We have to handle both systemd and sysvinit cases differently if [ -d /sys/fs/cgroup/systemd ]; then # bt-service changes USER to 'app' via libprivilege-control, so it needs # to know where the session bus is located under systemd export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/app/dbus/user_bus_socket -else - # Under systemd, bluetoothd is dbus activated. sysvinit requires it to be - # launched explicitly - /usr/sbin/bluetoothd -d fi -/usr/bin/bt-service & +# Execute BlueZ BT stack +echo "Run bluetoothd" +/usr/lib/bluetooth/bluetoothd -d -C & /usr/bin/bluetooth-share & exit 0 diff --git a/scripts/wearable/bt-reset-env.sh b/scripts/wearable/bt-reset-env.sh new file mode 100755 index 0000000..535aa35 --- /dev/null +++ b/scripts/wearable/bt-reset-env.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# BT Stack and device stop +/usr/etc/bluetooth/bt-stack-down.sh + +killall -9 hciattach + +# Remove BT files and setting +rm -rf /opt/data/bluetooth/.bt_paired +rm -rf /var/lib/bluetooth/* + +# Initialize BT vconf values +vconftool set -tf int db/bluetooth/status "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 + +# Remove BT shared memory +list=`ipcs -m | awk '$1==0x0001000 {print $2}'` +for i in $list +do + ipcrm -m $i +done +ipcs -m | grep "0x00001000" | awk '{ print $2 }' diff --git a/scripts/wearable/bt-stack-down.sh b/scripts/wearable/bt-stack-down.sh new file mode 100755 index 0000000..a1ca153 --- /dev/null +++ b/scripts/wearable/bt-stack-down.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# +# Script for stopping Bluetooth stack +# + +# 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 + +# result +exit 0 diff --git a/scripts/wearable/bt-stack-up.sh b/scripts/wearable/bt-stack-up.sh new file mode 100755 index 0000000..2c2074c --- /dev/null +++ b/scripts/wearable/bt-stack-up.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +HCIDUMP_DIR="/opt/usr/media/.bluetooth" +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" + +/usr/bin/bluetooth-hf-agent & +# +# Script for executing Bluetooth stack +# + +# Register BT Device +/usr/etc/bluetooth/bt-dev-start.sh + +if !(/usr/bin/hciconfig | grep hci); then + echo "Registering BT device is failed." + exit 1 +fi + +debug_mode=`cat /sys/module/sec_debug/parameters/enable` +debug_mode_user=`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} + + /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 + +# Execute BlueZ BT stack +echo "Run bluetoothd" +/usr/lib/bluetooth/bluetoothd -d -C & +/usr/bin/dbus-send --print-reply --system --type=method_call \ + --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 \ + org.freedesktop.systemd1.Manager.StartUnit \ + string:'wms.service' string:'fail' + +exit 0 -- 2.7.4