mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
Add autostart routine for btle_alarm
This commit is contained in:
parent
aa9d058747
commit
3dc434eb24
2 changed files with 26 additions and 2 deletions
7
Makefile
7
Makefile
|
|
@ -29,8 +29,11 @@ define Build/Prepare
|
|||
endef
|
||||
|
||||
define Package/btle_alarm/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/btle_alarm $(1)/usr/bin/
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/btle_alarm $(1)/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/etc/init.d/* $(1)/etc/init.d/
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,btle_alarm))
|
||||
|
|
|
|||
21
files/etc/init.d/btle_alarm
Executable file
21
files/etc/init.d/btle_alarm
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (C) 2009 OpenWrt.org
|
||||
#
|
||||
|
||||
START=99
|
||||
|
||||
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
|
||||
sleep 1
|
||||
/sbin/btle_alarm
|
||||
}
|
||||
|
||||
stop() {
|
||||
hciconfig hci0 down
|
||||
killall -9 btle_alarm
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue