Add new init routine for btle_alarm

This commit is contained in:
Stefan Nygren 2015-03-13 14:38:54 +01:00
parent d20174daed
commit 6699e1a741

View file

@ -9,7 +9,7 @@ start() {
for i in down reset up;do
hciconfig hci0 $i
done
mac=`uci get btle_alarm.mac`
mac=`uci get btle_alarm.Device.mac`
if [ $? -eq 0 ];then
hcitool lewladd $mac
else
@ -17,10 +17,13 @@ start() {
hcitool lewladd D0:39:72:B6:18:AA
fi
sleep 1
/sbin/btle_alarm
/sbin/btle_alarm &> /dev/null &
echo $! > /tmp/btle_alarm.pid
}
stop() {
hciconfig hci0 down
killall -9 btle_alarm
kill -9 `cat /tmp/btle_alarm.pid`
rm /tmp/btle_alarm.pid
sleep 1
}