Add the scripts for IVI profile 38/91738/1 accepted/tizen/common/20161011.154321 accepted/tizen/ivi/20161011.234213 accepted/tizen/mobile/20161011.234215 accepted/tizen/tv/20161011.234129 accepted/tizen/wearable/20161011.234133 submit/tizen/20161011.064815 submit/tizen_3.0_common/20161104.104000
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 11 Oct 2016 06:31:35 +0000 (15:31 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 11 Oct 2016 06:31:35 +0000 (15:31 +0900)
Change-Id: Ied091555aa5179be57614f550a0ccf79762713b3
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
packaging/bluetooth-tools.spec
scripts/CMakeLists.txt
scripts/ivi/bluetooth-address [new file with mode: 0755]
scripts/ivi/bt-reset-env.sh [new file with mode: 0755]
scripts/ivi/bt-stack-down.sh [new file with mode: 0644]
scripts/ivi/bt-stack-up.sh [new file with mode: 0644]

index d10eb11..c8a4ade 100644 (file)
@@ -1,6 +1,6 @@
 Name:       bluetooth-tools
 Summary:    Bluetooth-tools
-Version:    0.2.36
+Version:    0.2.37
 Release:    0
 Group:      Network & Connectivity/Bluetooth
 License:    Apache-2.0
@@ -45,13 +45,22 @@ export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
 %if "%{profile}" == "mobile"
        -DTIZEN_MOBILE=YES \
        -DTIZEN_WEARABLE=NO \
+       -DTIZEN_IVI=NO \
 %else
 %if "%{profile}" == "wearable"
        -DTIZEN_MOBILE=NO \
         -DTIZEN_WEARABLE=YES \
+       -DTIZEN_IVI=NO \
 %else
+%if "%{profile}" == "ivi"
         -DTIZEN_MOBILE=NO \
         -DTIZEN_WEARABLE=NO \
+       -DTIZEN_IVI=YES \
+%else
+        -DTIZEN_MOBILE=NO \
+        -DTIZEN_WEARABLE=NO \
+       -DTIZEN_IVI=NO \
+%endif
 %endif
 %endif
 
@@ -81,7 +90,7 @@ install -D -m 0644 LICENSE.APLv2 %{buildroot}%{_datadir}/license/bluetooth-tools
 %files
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
-%if "%{profile}" == "mobile" || "%{profile}" == "wearable"
+%if "%{profile}" == "mobile" || "%{profile}" == "wearable" || "%{profile}" == "ivi"
 %exclude %{_sysconfdir}/rc.d/init.d/bluetooth-address
 %else
 %{_sysconfdir}/rc.d/init.d/bluetooth-address
index f9a751e..59a9c84 100755 (executable)
@@ -13,11 +13,17 @@ INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/wearable/bt-stack-up.sh DESTINATION
 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 ()
+IF (TIZEN_IVI)
+INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/ivi/bt-stack-up.sh DESTINATION etc/bluetooth)
+INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/ivi/bt-stack-down.sh DESTINATION etc/bluetooth)
+INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/ivi/bt-reset-env.sh DESTINATION etc/bluetooth)
+ELSE ()
 INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/etc/bt-stack-up.sh DESTINATION etc/bluetooth)
 INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/etc/bt-stack-down.sh DESTINATION etc/bluetooth)
 INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/etc/bt-reset-env.sh DESTINATION etc/bluetooth)
 # install booting script
 INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/etc/bluetooth-address DESTINATION /etc/rc.d/init.d)
+ENDIF (TIZEN_IVI)
 ENDIF (TIZEN_WEARABLE)
 ENDIF (TIZEN_MOBILE)
 INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-edutm-on.sh DESTINATION etc/bluetooth)
diff --git a/scripts/ivi/bluetooth-address b/scripts/ivi/bluetooth-address
new file mode 100755 (executable)
index 0000000..de8d214
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+#
+# Script for setting local Bluetooth Address during booting time
+#
+
+if [ -x /usr/etc/bluetooth/bt-set-addr.sh ]; then
+       /usr/etc/bluetooth/bt-set-addr.sh &
+fi
diff --git a/scripts/ivi/bt-reset-env.sh b/scripts/ivi/bt-reset-env.sh
new file mode 100755 (executable)
index 0000000..8b7de64
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+# BT Stack and device stop
+/usr/etc/bluetooth/bt-stack-down.sh
+
+killall -9 hciattach
+
+# Remove BT files and setting
+eval $(tzplatform-get TZ_SYS_DATA)
+rm -rf $TZ_SYS_DATA/bluetooth/.bt_paired
+rm -rf /var/lib/bluetooth/*
+
+# Initialize BT vconf values
+vconftool set -f -t int db/bluetooth/status "0" -g 6520
+vconftool set -f -t int file/private/bt-service/flight_mode_deactivated "0" -g 6520
+vconftool set -f -t string memory/bluetooth/sco_headset_name "" -g 6520 -i
+vconftool set -f -t int memory/bluetooth/device "0" -g 6520 -i
+vconftool set -f -t int memory/bluetooth/btsco "0" -g 6520 -i
+vconftool set -f -t int file/private/libug-setting-bluetooth-efl/visibility_time "0" -g 6520
+vconftool set -f -t bool memory/private/bluetooth-share/quickpanel_clear_btn_status FALSE -g 6520 -i
+vconftool set -f -t 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/ivi/bt-stack-down.sh b/scripts/ivi/bt-stack-down.sh
new file mode 100644 (file)
index 0000000..f21de24
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+#
+# 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-hf-agent
+killall bluetoothd
+
+# result
+exit 0
diff --git a/scripts/ivi/bt-stack-up.sh b/scripts/ivi/bt-stack-up.sh
new file mode 100644 (file)
index 0000000..af0bd14
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+/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
+
+# 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
+fi
+
+# Execute BlueZ BT stack
+echo "Run bluetoothd"
+/usr/libexec/bluetooth/bluetoothd -d -C &
+
+exit 0