nabaztag_hack_kit 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/.travis.yml +3 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +4 -0
- data/README.md +119 -0
- data/Rakefile +21 -0
- data/bin/mtl_comp +41 -0
- data/bin/mtl_merge +22 -0
- data/bin/mtl_simu +40 -0
- data/bytecode/lib/buffer.mtl +109 -0
- data/bytecode/lib/button.mtl +27 -0
- data/bytecode/lib/data_helper.mtl +88 -0
- data/bytecode/lib/ear.mtl +90 -0
- data/bytecode/lib/led.mtl +33 -0
- data/bytecode/lib/rfid.mtl +50 -0
- data/bytecode/main.mtl +129 -0
- data/config.ru +6 -0
- data/ext/bytecode/Commands.md +172 -0
- data/ext/bytecode/Docs.md +488 -0
- data/ext/bytecode/README.md +5 -0
- data/ext/bytecode/lib/arp.mtl +159 -0
- data/ext/bytecode/lib/cfg.mtl +74 -0
- data/ext/bytecode/lib/choreos.mtl +1487 -0
- data/ext/bytecode/lib/dhcp.mtl +152 -0
- data/ext/bytecode/lib/dns.mtl +89 -0
- data/ext/bytecode/lib/http.mtl +84 -0
- data/ext/bytecode/lib/tcp.mtl +340 -0
- data/ext/bytecode/lib/udp.mtl +49 -0
- data/ext/bytecode/lib/util.mtl +74 -0
- data/ext/bytecode/lib/var.mtl +15 -0
- data/ext/bytecode/lib/wifi.mtl +243 -0
- data/ext/bytecode/nominal-ping.mtl +5828 -0
- data/ext/mtl/Makefile +42 -0
- data/ext/mtl/README.md +13 -0
- data/ext/mtl/bc.cpp +1891 -0
- data/ext/mtl/conf.bin.sans_password +0 -0
- data/ext/mtl/config.txt +5 -0
- data/ext/mtl/dumpbc.c +2566 -0
- data/ext/mtl/extconf.rb +1 -0
- data/ext/mtl/linux_simu.c +271 -0
- data/ext/mtl/linux_simuaudio.c +16 -0
- data/ext/mtl/linux_simuaudio.h +18 -0
- data/ext/mtl/linux_simunet.c +620 -0
- data/ext/mtl/linux_simunet.h +7 -0
- data/ext/mtl/log.c +297 -0
- data/ext/mtl/log.h +20 -0
- data/ext/mtl/main_compiler.cpp +104 -0
- data/ext/mtl/main_simu.cpp +221 -0
- data/ext/mtl/mp3/GTKANAL.H +97 -0
- data/ext/mtl/mp3/LAYER3.C +2090 -0
- data/ext/mtl/mp3/TABINIT.C +82 -0
- data/ext/mtl/mp3/common.c +265 -0
- data/ext/mtl/mp3/dct64_i386.c +316 -0
- data/ext/mtl/mp3/decode_i386.c +155 -0
- data/ext/mtl/mp3/huffman.h +332 -0
- data/ext/mtl/mp3/interface.c +258 -0
- data/ext/mtl/mp3/mpg123.h +182 -0
- data/ext/mtl/mp3/mpglib.h +44 -0
- data/ext/mtl/properties.c +293 -0
- data/ext/mtl/properties.h +10 -0
- data/ext/mtl/simu.c +750 -0
- data/ext/mtl/simuaudio.c +662 -0
- data/ext/mtl/simuaudio.h +74 -0
- data/ext/mtl/simunet.c +400 -0
- data/ext/mtl/simunet.h +30 -0
- data/ext/mtl/utils/correct_const.sh +34 -0
- data/ext/mtl/vaudio.c +677 -0
- data/ext/mtl/vaudio.h +46 -0
- data/ext/mtl/vbc.h +160 -0
- data/ext/mtl/vbc_str.h +166 -0
- data/ext/mtl/vcomp/Makefile +29 -0
- data/ext/mtl/vcomp/bootstrap.cpp +89 -0
- data/ext/mtl/vcomp/compiler.cpp +470 -0
- data/ext/mtl/vcomp/compiler.h +200 -0
- data/ext/mtl/vcomp/compiler_file.cpp +929 -0
- data/ext/mtl/vcomp/compiler_prog.cpp +250 -0
- data/ext/mtl/vcomp/compiler_term.cpp +1053 -0
- data/ext/mtl/vcomp/compiler_type.cpp +872 -0
- data/ext/mtl/vcomp/compiler_var.cpp +289 -0
- data/ext/mtl/vcomp/file.cpp +79 -0
- data/ext/mtl/vcomp/file.h +39 -0
- data/ext/mtl/vcomp/filesystem.h +14 -0
- data/ext/mtl/vcomp/interpreter.cpp +85 -0
- data/ext/mtl/vcomp/interpreter.h +121 -0
- data/ext/mtl/vcomp/memory.cpp +241 -0
- data/ext/mtl/vcomp/memory.h +326 -0
- data/ext/mtl/vcomp/param.h +95 -0
- data/ext/mtl/vcomp/parser.cpp +427 -0
- data/ext/mtl/vcomp/parser.h +97 -0
- data/ext/mtl/vcomp/parser_xml.cpp +124 -0
- data/ext/mtl/vcomp/prodbuffer.cpp +125 -0
- data/ext/mtl/vcomp/prodbuffer.h +42 -0
- data/ext/mtl/vcomp/resource.h +17 -0
- data/ext/mtl/vcomp/stdlib_core.cpp +122 -0
- data/ext/mtl/vcomp/terminal.cpp +73 -0
- data/ext/mtl/vcomp/terminal.h +30 -0
- data/ext/mtl/vcomp/util.cpp +48 -0
- data/ext/mtl/vcomp/util.h +31 -0
- data/ext/mtl/vinterp.c +1349 -0
- data/ext/mtl/vinterp.h +11 -0
- data/ext/mtl/vloader.c +127 -0
- data/ext/mtl/vloader.h +31 -0
- data/ext/mtl/vlog.c +589 -0
- data/ext/mtl/vlog.h +69 -0
- data/ext/mtl/vmem.c +424 -0
- data/ext/mtl/vmem.h +107 -0
- data/ext/mtl/vnet.c +255 -0
- data/ext/mtl/vnet.h +19 -0
- data/lib/nabaztag_hack_kit/message/api.rb +39 -0
- data/lib/nabaztag_hack_kit/message/helper.rb +39 -0
- data/lib/nabaztag_hack_kit/message.rb +36 -0
- data/lib/nabaztag_hack_kit/server.rb +50 -0
- data/lib/nabaztag_hack_kit/version.rb +3 -0
- data/lib/nabaztag_hack_kit.rb +4 -0
- data/nabaztag_hack_kit.gemspec +29 -0
- data/public/bytecode.bin +0 -0
- data/test/bytecode/helper.mtl +60 -0
- data/test/bytecode/native.mtl +28 -0
- data/test/bytecode/test.mtl +221 -0
- data/test/spec_helper.rb +5 -0
- data/test/unit/message_spec.rb +56 -0
- metadata +209 -0
@@ -0,0 +1,74 @@
|
|
1
|
+
// ------------- Config
|
2
|
+
|
3
|
+
const CONF_SERVERURL=0;; //41
|
4
|
+
const CONF_NETDHCP=41;; //1
|
5
|
+
const CONF_NETIP=42;; //4
|
6
|
+
const CONF_NETMASK=46;; //4
|
7
|
+
const CONF_NETGATEWAY=50;; //4
|
8
|
+
const CONF_NETDNS=54;; //4
|
9
|
+
const CONF_WIFISSID=58;; //32
|
10
|
+
const CONF_WIFIAUTH=90;; //1
|
11
|
+
const CONF_WIFICRYPT=91;; //1
|
12
|
+
const CONF_WIFIKEY0=92;; //64
|
13
|
+
const CONF_PROXYENABLE=156;; //1
|
14
|
+
const CONF_PROXYIP=157;; //4
|
15
|
+
const CONF_PROXYPORT=161;; //2
|
16
|
+
const CONF_LOGIN=163;; //6
|
17
|
+
const CONF_PWD=169;; //6
|
18
|
+
const CONF_WIFIPMK=175;; //32
|
19
|
+
const CONF_MAGIC=207;; //1
|
20
|
+
const CONF_LENGTH=208;;
|
21
|
+
|
22
|
+
var conf;;
|
23
|
+
|
24
|
+
fun confSave=
|
25
|
+
Secholn "## save configuration";
|
26
|
+
//dump conf;
|
27
|
+
save conf 0 "conf.bin" 0 CONF_LENGTH;;
|
28
|
+
|
29
|
+
fun confInit=
|
30
|
+
set conf=strnew CONF_LENGTH;
|
31
|
+
load conf 0 "conf.bin" 0 CONF_LENGTH;;
|
32
|
+
//dump conf;;
|
33
|
+
|
34
|
+
fun confGet i len= strsub conf i len;;
|
35
|
+
|
36
|
+
fun confGetbin i len= strsub conf i len;;
|
37
|
+
|
38
|
+
fun confGetstr i len=
|
39
|
+
let strstr conf "\0" i -> j in
|
40
|
+
strsub conf i (if j==nil then len else min len j-i);;
|
41
|
+
|
42
|
+
fun confSet i val len=
|
43
|
+
strcpy conf i val 0 len;;
|
44
|
+
|
45
|
+
fun confSetbin i val len=strcpy conf i val 0 len;;
|
46
|
+
|
47
|
+
fun confSetstr i val len=
|
48
|
+
let min strlen val len-1 -> len in
|
49
|
+
(
|
50
|
+
strcpy conf i val 0 len;
|
51
|
+
strset conf i+len 0
|
52
|
+
);;
|
53
|
+
|
54
|
+
fun webport s= ((strget s 0)<<8)+strget s 1;;
|
55
|
+
|
56
|
+
fun confGetWifissid=confGetstr CONF_WIFISSID 32;;
|
57
|
+
fun confGetWificrypt=strget confGet CONF_WIFICRYPT 1 0;;
|
58
|
+
fun confGetWifikey0=confGetstr CONF_WIFIKEY0 64;;
|
59
|
+
fun confGetWifiauth=strget confGet CONF_WIFIAUTH 1 0;;
|
60
|
+
fun confGetWifipmk=confGetbin CONF_WIFIPMK 32;;
|
61
|
+
|
62
|
+
fun confGetDhcp=strget confGet CONF_NETDHCP 1 0;;
|
63
|
+
fun confGetNetip=confGet CONF_NETIP 4;;
|
64
|
+
fun confGetNetmask=confGet CONF_NETMASK 4;;
|
65
|
+
fun confGetNetgateway=confGet CONF_NETGATEWAY 4;;
|
66
|
+
fun confGetNetdns=confGet CONF_NETDNS 4;;
|
67
|
+
|
68
|
+
fun confGetServerUrl=confGetstr CONF_SERVERURL 40;;
|
69
|
+
fun confGetLogin=confGet CONF_LOGIN 6;;
|
70
|
+
fun confGetPwd=confGet CONF_PWD 6;;
|
71
|
+
|
72
|
+
fun confGetProxy=strget confGet CONF_PROXYENABLE 1 0;;
|
73
|
+
fun confGetProxyip=confGet CONF_PROXYIP 4;;
|
74
|
+
fun confGetProxyport=webport confGet CONF_PROXYPORT 2;;
|