added sky shell basic commands test.
This commit is contained in:
parent
875be00548
commit
94b06b4617
3 changed files with 123 additions and 0 deletions
70
tools/cooja/contiki_tests/sky_shell_basic_commands.csc
Normal file
70
tools/cooja/contiki_tests/sky_shell_basic_commands.csc
Normal file
|
@ -0,0 +1,70 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<simconf>
|
||||
<simulation>
|
||||
<title>My simulation</title>
|
||||
<delaytime>0</delaytime>
|
||||
<ticktime>1</ticktime>
|
||||
<randomseed>123456</randomseed>
|
||||
<motedelay>1000</motedelay>
|
||||
<radiomedium>
|
||||
se.sics.cooja.radiomediums.UDGM
|
||||
<transmitting_range>50.0</transmitting_range>
|
||||
<interference_range>100.0</interference_range>
|
||||
<success_ratio_tx>1.0</success_ratio_tx>
|
||||
<success_ratio_rx>1.0</success_ratio_rx>
|
||||
</radiomedium>
|
||||
<motetype>
|
||||
se.sics.cooja.mspmote.SkyMoteType
|
||||
<identifier>sky1</identifier>
|
||||
<description>Sky Mote Type #1</description>
|
||||
<source>../../../examples/sky-shell/sky-shell.c</source>
|
||||
<command>make sky-shell.sky TARGET=sky</command>
|
||||
</motetype>
|
||||
<mote>
|
||||
se.sics.cooja.mspmote.SkyMote
|
||||
<motetype_identifier>sky1</motetype_identifier>
|
||||
<interface_config>
|
||||
se.sics.cooja.interfaces.Position
|
||||
<x>62.86427076032819</x>
|
||||
<y>38.98246035522194</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>1</id>
|
||||
</interface_config>
|
||||
</mote>
|
||||
</simulation>
|
||||
<plugin>
|
||||
se.sics.cooja.plugins.SimControl
|
||||
<width>302</width>
|
||||
<z>1</z>
|
||||
<height>187</height>
|
||||
<location_x>0</location_x>
|
||||
<location_y>0</location_y>
|
||||
<minimized>false</minimized>
|
||||
</plugin>
|
||||
<plugin>
|
||||
se.sics.cooja.plugins.VisState
|
||||
<width>300</width>
|
||||
<z>3</z>
|
||||
<height>300</height>
|
||||
<location_x>390</location_x>
|
||||
<location_y>0</location_y>
|
||||
<minimized>false</minimized>
|
||||
</plugin>
|
||||
<plugin>
|
||||
se.sics.cooja.plugins.LogListener
|
||||
<plugin_config>
|
||||
<filter />
|
||||
<history>256</history>
|
||||
</plugin_config>
|
||||
<width>690</width>
|
||||
<z>2</z>
|
||||
<height>190</height>
|
||||
<location_x>0</location_x>
|
||||
<location_y>457</location_y>
|
||||
<minimized>false</minimized>
|
||||
</plugin>
|
||||
</simconf>
|
||||
|
1
tools/cooja/contiki_tests/sky_shell_basic_commands.info
Normal file
1
tools/cooja/contiki_tests/sky_shell_basic_commands.info
Normal file
|
@ -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
|
52
tools/cooja/contiki_tests/sky_shell_basic_commands.js
Normal file
52
tools/cooja/contiki_tests/sky_shell_basic_commands.js
Normal file
|
@ -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 <filename>')) {
|
||||
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! */
|
Loading…
Reference in a new issue