mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
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:
parent
3dc434eb24
commit
e4258501a9
3 changed files with 8 additions and 2 deletions
1
Makefile
1
Makefile
|
|
@ -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
0
files/btle_alarm.cfg
Normal 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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue