%post rpi3
rm -rf %{_prefix}/etc/bluetooth/bt-dev-start.sh
+rm -rf %{_prefix}/etc/bluetooth/bt-dev-end.sh
ln -s %{_prefix}/etc/bluetooth/bt-dev-start-rpi3.sh %{_prefix}/etc/bluetooth/bt-dev-start.sh
+ln -s %{_prefix}/etc/bluetooth/bt-dev-end-rpi3.sh %{_prefix}/etc/bluetooth/bt-dev-end.sh
%files rpi3
%manifest %{name}.manifest
%license LICENSE.APLv2 LICENSE.Broadcom
%defattr(-,root,root,-)
%{_prefix}/etc/bluetooth/BCM43430A1.hcd
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
+%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end-rpi3.sh
%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-rpi3.sh
%manifest %{name}.manifest
--- /dev/null
+#!/bin/sh
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+PGREP=/usr/bin/pgrep
+
+#
+# Script for stopping Broadcom UART Bluetooth stack
+#
+
+# Device down
+/usr/bin/hciconfig hci0 down
+
+# OMAP4
+REVISION_NUM=`grep Revision /proc/cpuinfo | awk "{print \\$3}"`
+if [ $REVISION_NUM == "0006" ]; then
+ rmmod bt_drv.ko
+ rmmod st_drv.ko
+ sleep 1
+ UIM_RFKILL_PID=$($PGREP uim_rfkill)
+ kill $UIM_RFKILL_PID
+ exit 0
+fi
+
+#if [ -e /sys/class/gpio/gpio17/value ]
+#then
+# # Reset BT chip
+# echo 0 > /sys/class/gpio/gpio17/value
+# sleep 0.1
+# echo 1 > /sys/class/gpio/gpio17/value
+#fi
+