<manifest>
- <define>
- <domain name="bluetooth-tools"/>
- </define>
- <assign>
- <filesystem path="/etc/rc.d/init.d/bluetooth-address" label="_" exec_label="none"/>
- <filesystem path="/etc/rc.d/rc3.d/S60bluetooth-address" label="_" exec_label="none"/>
- <filesystem path="/etc/rc.d/rc5.d/S60bluetooth-address" label="_" exec_label="none"/>
- <filesystem path="/usr/lib/systemd/system/bluetooth-address.service" label="_" exec_label="none" />
- <filesystem path="/usr/lib/systemd/system/multi-user.target.wants/bluetooth-address.service" label="_" exec_label="none" />
- </assign>
<request>
- <domain name="bluetooth-tools"/>
+ <domain name="_"/>
</request>
</manifest>
Name: bluetooth-tools
-Summary: bluetooth-tools
+Summary: Bluetooth-tools
Version: 0.2.35
Release: 3
-Group: TO_BE/FILLED_IN
-License: Apache License, Version 2.0
+Group: Network & Connectivity/Bluetooth
+License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
Source1001: bluetooth-address.service
BuildRequires: cmake
+Requires : bluetooth-tools-no-firmware
%description
Tools fo bluetooth run/stop and set address
+%package no-firmware
+Summary: On/Off Bluetooth adapter
+Group: Network & Connectivity/Bluetooth
+Requires: %{name} = %{version}-%{release}
+Requires: rfkill
+Conflicts: bluetooth-firmware-bcm
+
+%description no-firmware
+On/Off bluetooth device
%prep
%setup -q
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
+mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
+install -m 0644 %{SOURCE1001} %{buildroot}%{_unitdir}
+ln -s ../bluetooth-address.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-address.service
+mkdir -p %{buildroot}%{_prefix}/etc/bluetooth/
+install -m 0755 scripts/bt-dev-start.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-start.sh
+install -m 0755 scripts/bt-dev-end.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-end.sh
%files
-%manifest bluetooth-tools.manifest
+%manifest %{name}.manifest
%defattr(-,root,root,-)
%{_sysconfdir}/rc.d/init.d/bluetooth-address
%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
%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
+%{_unitdir}/multi-user.target.wants/bluetooth-address.service
+%{_unitdir}/bluetooth-address.service
+
+%files no-firmware
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
+%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh
--- /dev/null
+#!/bin/sh
+
+# Script for registering BT device
+BT_PLATFORM_DEFAULT_HCI_NAME="Tizen"
+
+# Trun-on Bluetooth Chip
+
+/usr/sbin/rfkill unblock bluetooth
+
+echo "Check for Bluetooth device status"
+if (/usr/sbin/hciconfig | grep hci); then
+ echo "Bluetooth device is UP"
+ /usr/sbin/hciconfig hci0 up
+else
+ echo "Bluetooth device is DOWN"
+ echo "Registering Bluetooth device"
+ /usr/sbin/hciconfig hci0 up
+ /usr/sbin/hciconfig hci0 name $BT_PLATFORM_DEFAULT_HCI_NAME
+ /usr/sbin/hciconfig hci0 sspmode 1
+fi