Add uci configuration to package

Config file to be able to use UCI to store bluetooth mac of device
refs #6142
This commit is contained in:
Stefan Nygren 2015-03-11 13:13:51 +01:00
parent 3dc434eb24
commit e4258501a9
3 changed files with 8 additions and 2 deletions

View file

@ -32,6 +32,7 @@ define Package/btle_alarm/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/btle_alarm $(1)/sbin/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DATA) ./files/btle_alarm.conf $(1)/etc/config/btle_alarm
$(INSTALL_BIN) ./files/etc/init.d/* $(1)/etc/init.d/
endef

0
files/btle_alarm.cfg Normal file
View file

View file

@ -9,8 +9,13 @@ start() {
for i in down reset up;do
hciconfig hci0 $i
done
hcitool lewladd D0:39:72:B6:43:8A
hcitool lewladd D0:39:72:B6:18:AA
mac=`uci get btle_alarm.mac`
if [ $? -eq 0 ];then
hcitool lewladd $mac
else
hcitool lewladd D0:39:72:B6:43:8A
hcitool lewladd D0:39:72:B6:18:AA
fi
sleep 1
/sbin/btle_alarm
}