Skip to content

Commit

Permalink
Missile Control
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasKotlyar committed Feb 17, 2018
1 parent 5618c0d commit f60b183
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 0 deletions.
Binary file added firmware_mod/bin/USBMissileLauncherUtils
Binary file not shown.
Binary file added firmware_mod/lib/libusb-0.1.so.4
Binary file not shown.
Binary file added firmware_mod/lib/libusb-1.0.so.0
Binary file not shown.
65 changes: 65 additions & 0 deletions firmware_mod/www/cgi-bin/missile.cgi
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/sh

echo "Content-type: text/html"
echo ""

cat << EOF
<!DOCTYPE html>
<html>
<head>
<title>Fang Hacks</title>
<style type="text/css">
body { background-color: #B0E0E6; font-family: verdana, sans-serif; }
.err { color: red; }
hr { height: 1px; border: 0; border-top: 1px solid #aaa; }
button, input[type=submit] { background-color: #ddeaff; }
.tbl { border-collapse: collapse; border-spacing: 0;}
.tbl th { text-align: left; vertical-align: top; font-weight: bold; padding: 10px 5px; border-style: solid; border-width: 1px; overflow: hidden; word-break: normal; }
.tbl td { padding: 10px 5px; border-style: solid; border-width: 1px; overflow: hidden; word-break: normal; }
</style>
</head>
<body>
EOF
source header.cgi
cat << EOF
<br/>
<br/>
</div>
</p>
<hr/>
<table class='tbl'>
<script>
function call(url){
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.send();
}
</script>
<tr>
<th>Missile:</th>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;<button title="" type="button" onclick="call('missile_cmd.cgi?cmd=-U')">&nbsp;Up&nbsp;</button>
<br>
<button title="" type="button" onclick="call('missile_cmd.cgi?cmd=-L')">Left</button>&nbsp;
<button title="" type="button" onclick="call('missile_cmd.cgi?cmd=-R')">Right</button>
<br>
&nbsp;&nbsp;&nbsp;<button title="" type="button" onclick="call('missile_cmd.cgi?cmd=-D')">Down</button>
&nbsp;&nbsp;&nbsp;
<button title='' type='button' onClick="call('missile_cmd.cgi?cmd=-F')">Fire</button>
</td>
<td>
<button title='' type='button' onClick="call('missile_cmd.cgi?cmd=-F')">Fire</button>
</td>
</tr>
</table>
</div>
</body>
</html>
EOF
10 changes: 10 additions & 0 deletions firmware_mod/www/cgi-bin/missile_cmd.cgi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
source func.cgi
export LD_LIBRARY_PATH=/system/sdcard/lib
CMD=$F_cmd


/system/sdcard/bin/USBMissileLauncherUtils $CMD -S 200

echo "Content-type: text/html"
echo ""

0 comments on commit f60b183

Please sign in to comment.