2 * Script that mimics the behavior of the mote-exec subcommand.
5 var accessDone
= new java
.lang
.Runnable() {
9 println("Access granted");
10 mote
.control(controlDone
);
15 var controlDone
= new java
.lang
.Runnable() {
19 println("Control granted");
22 mote
.program(args
[1], programDone
);
27 var consoleDone
= new java
.lang
.Runnable() {
31 println("Console setup");
36 var programDone
= new java
.lang
.Runnable() {
40 println("Starting the program");
41 mote
.start(commandDone
);
46 var commandDone
= new java
.lang
.Runnable() {
55 if (args
[0] == undefined)
56 command
.die("Mote ID required as the first argument");
57 if (args
[1] == undefined)
58 command
.die("Mote program request as the second argument");
60 println("Using mote " + args
[0]);
61 mote
= command
.getMote(args
[0]);
63 println("Get access");
64 mote
.access(accessDone
);