three patches to simplify loading TinyOS firmwares (via MSPSim), contributed by Philipp Sommer

This commit is contained in:
fros4943 2010-03-08 14:26:12 +00:00
parent 03605a568c
commit df8cc48739
3 changed files with 29 additions and 8 deletions

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: MspCompileDialog.java,v 1.1 2009/12/02 16:27:32 fros4943 Exp $
* $Id: MspCompileDialog.java,v 1.2 2010/03/08 14:26:12 fros4943 Exp $
*/
package se.sics.cooja.mspmote;
@ -40,6 +40,7 @@ import se.sics.cooja.Simulation;
import se.sics.cooja.dialogs.AbstractCompileDialog;
public class MspCompileDialog extends AbstractCompileDialog {
private static final long serialVersionUID = -7273193946433145019L;
private String target;
public static boolean showDialog(
@ -79,6 +80,9 @@ public class MspCompileDialog extends AbstractCompileDialog {
if (file.getName().endsWith("." + target)) {
return true;
}
if (file.getName().equals("main.exe")) {
return true;
}
return false;
}

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: MspMoteID.java,v 1.15 2010/02/05 08:44:57 fros4943 Exp $
* $Id: MspMoteID.java,v 1.16 2010/03/08 14:26:12 fros4943 Exp $
*/
package se.sics.cooja.mspmote.interfaces;
@ -198,16 +198,33 @@ public class MspMoteID extends MoteID {
if (moteMem.variableExists("rseed")) {
moteMem.setIntValueOf("rseed", (int) (mote.getSimulation().getRandomSeed() + newID));
}
moteMem.setIntValueOf("TOS_NODE_ID", newID);
moteMem.setIntValueOf("ActiveMessageAddressC$addr", newID);
if (moteMem.variableExists("TOS_NODE_ID")) {
moteMem.setIntValueOf("TOS_NODE_ID", newID);
}
if (moteMem.variableExists("ActiveMessageAddressC__addr")) {
moteMem.setIntValueOf("ActiveMessageAddressC__addr", newID);
}
if (moteMem.variableExists("ActiveMessageAddressC$addr")) {
moteMem.setIntValueOf("ActiveMessageAddressC$addr", newID);
}
setChanged();
notifyObservers();
return;
}
if (location == ID_LOCATION.VARIABLE_TOS_NODE_ID) {
moteMem.setIntValueOf("TOS_NODE_ID", newID);
moteMem.setIntValueOf("ActiveMessageAddressC$addr", newID);
if (moteMem.variableExists("TOS_NODE_ID")) {
moteMem.setIntValueOf("TOS_NODE_ID", newID);
}
if (moteMem.variableExists("ActiveMessageAddressC__addr")) {
moteMem.setIntValueOf("ActiveMessageAddressC__addr", newID);
}
if (moteMem.variableExists("ActiveMessageAddressC$addr")) {
moteMem.setIntValueOf("ActiveMessageAddressC$addr", newID);
}
setChanged();
notifyObservers();
return;

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: AbstractCompileDialog.java,v 1.8 2009/10/28 12:02:21 fros4943 Exp $
* $Id: AbstractCompileDialog.java,v 1.9 2010/03/08 14:26:12 fros4943 Exp $
*/
package se.sics.cooja.dialogs;
@ -205,7 +205,7 @@ public abstract class AbstractCompileDialog extends JDialog {
}
public String getDescription() {
return "Contiki process source or Contiki firmware";
return "Contiki process source or Precompiled firmware";
}
});
fc.setDialogTitle("Select Contiki process source");