From 3a06219c1e0b1c123e2b2fc135211eff2bc0a404 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 17 Sep 2008 21:54:15 +0000 Subject: [PATCH] added contiki test: cooja testapp hello world --- .../cooja/contiki_tests/cooja_helloworld.csc | 85 +++++++++++++++++++ .../cooja/contiki_tests/cooja_helloworld.info | 1 + tools/cooja/contiki_tests/cooja_helloworld.js | 13 +++ 3 files changed, 99 insertions(+) create mode 100644 tools/cooja/contiki_tests/cooja_helloworld.csc create mode 100644 tools/cooja/contiki_tests/cooja_helloworld.info create mode 100644 tools/cooja/contiki_tests/cooja_helloworld.js diff --git a/tools/cooja/contiki_tests/cooja_helloworld.csc b/tools/cooja/contiki_tests/cooja_helloworld.csc new file mode 100644 index 000000000..4af9894e9 --- /dev/null +++ b/tools/cooja/contiki_tests/cooja_helloworld.csc @@ -0,0 +1,85 @@ + + + + Hello World + 0 + 1 + 123456 + 1 + 0 + + se.sics.cooja.radiomediums.UDGM + 50.0 + 100.0 + 1.0 + 1.0 + + + se.sics.cooja.contikimote.ContikiMoteType + mtype3 + Contiki Mote #1 + ../../.. + ../../../platform/cooja + ../apps/mrm + ../apps/mspsim + ../../../platform/cooja/testapps + hello-world.c + hello_world_process + button_sensor + pir_sensor + radio_sensor + vib_sensor + se.sics.cooja.interfaces.Position + se.sics.cooja.interfaces.Battery + se.sics.cooja.contikimote.interfaces.ContikiVib + se.sics.cooja.contikimote.interfaces.ContikiMoteID + se.sics.cooja.contikimote.interfaces.ContikiRS232 + se.sics.cooja.contikimote.interfaces.ContikiBeeper + se.sics.cooja.contikimote.interfaces.ContikiIPAddress + se.sics.cooja.contikimote.interfaces.ContikiRadio + se.sics.cooja.contikimote.interfaces.ContikiButton + se.sics.cooja.contikimote.interfaces.ContikiPIR + se.sics.cooja.contikimote.interfaces.ContikiClock + se.sics.cooja.contikimote.interfaces.ContikiLED + se.sics.cooja.contikimote.interfaces.ContikiLog + se.sics.cooja.contikimote.interfaces.ContikiCFS + cfs_interface + beep_interface + button_interface + radio_interface + ip_interface + leds_interface + moteid_interface + pir_interface + rs232_interface + vib_interface + clock_interface + simlog_interface + false + Rime + + + se.sics.cooja.contikimote.ContikiMote + mtype3 + + se.sics.cooja.interfaces.Position + 91.48300003917207 + 83.5491879028037 + 0.0 + + + se.sics.cooja.contikimote.interfaces.ContikiMoteID + 1 + + + se.sics.cooja.contikimote.interfaces.ContikiIPAddress + 10.10.15.14 + + + se.sics.cooja.interfaces.Battery + false + + + + + diff --git a/tools/cooja/contiki_tests/cooja_helloworld.info b/tools/cooja/contiki_tests/cooja_helloworld.info new file mode 100644 index 000000000..6391380b4 --- /dev/null +++ b/tools/cooja/contiki_tests/cooja_helloworld.info @@ -0,0 +1 @@ +Cooja testapp: Hello world (single node, OS-level) \ No newline at end of file diff --git a/tools/cooja/contiki_tests/cooja_helloworld.js b/tools/cooja/contiki_tests/cooja_helloworld.js new file mode 100644 index 000000000..0016c065a --- /dev/null +++ b/tools/cooja/contiki_tests/cooja_helloworld.js @@ -0,0 +1,13 @@ +/* Script is called once for every node log output. */ +/* Input variables: Mote mote, int id, String msg. */ + +log.log('MOTE=' + mote + '\n'); +log.log('ID=' + id + '\n'); +log.log('TIME=' + mote.getSimulation().getSimulationTime() + '\n'); +log.log('MSG=' + msg + '\n'); + +if (msg.startsWith('Hello, world')) { + log.log('TEST OK\n'); /* Report test success */ + /* To increase test run speed, close the simulator when done */ + mote.getSimulation().getGUI().doQuit(false); /* Quit simulator (to end test run)*/ +}