13 changed files with 141 additions and 10 deletions
-
2CMakeLists.txt
-
4env/app.sh
-
15env/app_monitor.sh
-
4env/rootfs/var/spool/cron/crontabs/root
-
0env/speaker_control.sh
-
4env/startup.sh
-
9sh/boardinit.sh
-
3src/configs/gconfig.hpp
-
29src/main.cpp
-
11src/service/main_control_service.cpp
-
7src/service/main_control_service.hpp
-
8webapp/debug/device_test.html
-
51webapp/debug/wakeup_control.html
@ -0,0 +1,4 @@ |
|||||
|
#!/bin/bash |
||||
|
cd /app |
||||
|
source /etc/device_info.env |
||||
|
./app.out --device_id ${DEVICE_ID} --aiui_auth_id ${AIUI_AUTH_ID} |
@ -0,0 +1,15 @@ |
|||||
|
# |
||||
|
# 1. 监听app.out,如果app.out退出,则重启app.out |
||||
|
# |
||||
|
|
||||
|
# 1. 监听app.out,如果app.out退出,则重启app.out |
||||
|
while true; do |
||||
|
ps -ef | grep app.out | grep -v grep |
||||
|
if [ $? -ne 0 ]; then |
||||
|
echo "app.out is not running, restart it" |
||||
|
cd /app |
||||
|
./app.sh |
||||
|
fi |
||||
|
sleep 1 |
||||
|
done |
||||
|
|
@ -0,0 +1,4 @@ |
|||||
|
# |
||||
|
# 定时任务,每天晚上12点,自动杀死应用程序 |
||||
|
# |
||||
|
0 0 * * * killall app.out |
@ -1,3 +1,5 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
cd /app |
cd /app |
||||
./app.out & |
|
||||
|
firefox --kiosk www.baidu.com |
||||
|
./app.sh |
||||
|
./app_monitor.sh & |
@ -0,0 +1,51 @@ |
|||||
|
<!doctype html> |
||||
|
<html> |
||||
|
|
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script> |
||||
|
<script src="../js/zcmd.js"></script> |
||||
|
<meta name="viewport" content="width=device-width,initial-scale=1"> |
||||
|
<title>唤醒测试</title> |
||||
|
<style> |
||||
|
</style> |
||||
|
<script> |
||||
|
</script> |
||||
|
</head> |
||||
|
|
||||
|
<body> |
||||
|
<script> |
||||
|
var zcmd = new ZCommand(); |
||||
|
zcmd.set_onSendraw(function (data) { |
||||
|
console.log("zcmd send:" + JSON.stringify(data, null, 0)); |
||||
|
}); |
||||
|
zcmd.set_onReceipt(function (tx, rx) { |
||||
|
console.log("zcmd receipt:" + JSON.stringify(rx, null, 0)); |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
<div> |
||||
|
<h1>唤醒测试</h1> |
||||
|
<table> |
||||
|
<tr> |
||||
|
<td>triggerWakeup</td> |
||||
|
<td>-</td> |
||||
|
<td><button |
||||
|
onclick='zcmd.send_message({"command": "triggerWakeup"},2000).then((data) => {alert(JSON.stringify(data,null,2))})'>Trigger</button> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<script> |
||||
|
$(function () { |
||||
|
// ZWSURL = "ws://127.0.0.1:19000"; |
||||
|
zcmd.start_auto_connect(ZWSURL); |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
</body> |
||||
|
|
||||
|
</html> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue