diff --git a/tools/cooja/contiki_tests/sky_shell_basic_commands.csc b/tools/cooja/contiki_tests/sky_shell_basic_commands.csc new file mode 100644 index 000000000..549fc3713 --- /dev/null +++ b/tools/cooja/contiki_tests/sky_shell_basic_commands.csc @@ -0,0 +1,70 @@ + + + + My simulation + 0 + 1 + 123456 + 1000 + + se.sics.cooja.radiomediums.UDGM + 50.0 + 100.0 + 1.0 + 1.0 + + + se.sics.cooja.mspmote.SkyMoteType + sky1 + Sky Mote Type #1 + ../../../examples/sky-shell/sky-shell.c + make sky-shell.sky TARGET=sky + + + se.sics.cooja.mspmote.SkyMote + sky1 + + se.sics.cooja.interfaces.Position + 62.86427076032819 + 38.98246035522194 + 0.0 + + + se.sics.cooja.mspmote.interfaces.MspMoteID + 1 + + + + + se.sics.cooja.plugins.SimControl + 302 + 1 + 187 + 0 + 0 + false + + + se.sics.cooja.plugins.VisState + 300 + 3 + 300 + 390 + 0 + false + + + se.sics.cooja.plugins.LogListener + + + 256 + + 690 + 2 + 190 + 0 + 457 + false + + + diff --git a/tools/cooja/contiki_tests/sky_shell_basic_commands.info b/tools/cooja/contiki_tests/sky_shell_basic_commands.info new file mode 100644 index 000000000..b88de7244 --- /dev/null +++ b/tools/cooja/contiki_tests/sky_shell_basic_commands.info @@ -0,0 +1 @@ +Contiki shell on a single Tmote Sky. When the node has booted, a two commands are sent to the shell: help and ps diff --git a/tools/cooja/contiki_tests/sky_shell_basic_commands.js b/tools/cooja/contiki_tests/sky_shell_basic_commands.js new file mode 100644 index 000000000..c0f78cb2e --- /dev/null +++ b/tools/cooja/contiki_tests/sky_shell_basic_commands.js @@ -0,0 +1,52 @@ +/* Wait until node has booted */ +if (msg.startsWith('Starting')) { + log.log("Shell started\n"); + global.put("started", true); +} +result = global.get("started"); +if (result == null || result == false) { + /*log.log("Shell did not yet start\n");*/ + return; +} + +/* Send command ps */ +result = global.get("command_ps"); +if (result == null || result == false) { + log.log("Sending 'ps'\n"); + global.put("command_ps", true); + node.write("ps"); + return; +} + +/* Wait for ps response */ +if (msg.startsWith('Event timer')) { + log.log("Reponse from 'ps'\n"); + global.put("response_ps", true); +} +result = global.get("response_ps"); +if (result == null || result == false) { + /*log.log("Waiting for 'ps' response\n");*/ + return; +} + +/* Send command help */ +result = global.get("command_help"); +if (result == null || result == false) { + log.log("Sending 'help'\n"); + global.put("command_help", true); + node.write("help"); + return; +} + +/* Wait for help response */ +if (msg.startsWith('write ')) { + log.log("Reponse from 'help'\n"); + global.put("response_help", true); +} +result = global.get("response_help"); +if (result == null || result == false) { + /*log.log("Waiting for 'help' response\n");*/ + return; +} + +log.testOK(); /* We are done! */ \ No newline at end of file