From b526851ac198e76b39eecaaffb8afab187e14e43 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Thu, 17 Sep 2009 11:12:25 +0000 Subject: [PATCH] added getID() stub to avoid compiler errors: the application motes does not yet respect the configured mote IDs --- .../cooja/motes/AbstractApplicationMote.java | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/motes/AbstractApplicationMote.java b/tools/cooja/java/se/sics/cooja/motes/AbstractApplicationMote.java index d58da3d17..a73bd3b85 100644 --- a/tools/cooja/java/se/sics/cooja/motes/AbstractApplicationMote.java +++ b/tools/cooja/java/se/sics/cooja/motes/AbstractApplicationMote.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: AbstractApplicationMote.java,v 1.4 2009/03/09 15:38:10 fros4943 Exp $ + * $Id: AbstractApplicationMote.java,v 1.5 2009/09/17 11:12:25 fros4943 Exp $ */ package se.sics.cooja.motes; @@ -91,20 +91,6 @@ public abstract class AbstractApplicationMote implements Mote { } } - public void setState(State newState) { - logger.fatal("Application mote can not change state"); - } - - public State getState() { - return Mote.State.ACTIVE; - } - - public void addStateObserver(Observer newObserver) { - } - - public void deleteStateObserver(Observer newObserver) { - } - public MoteInterfaceHandler getInterfaces() { return moteInterfaces; } @@ -163,7 +149,7 @@ public abstract class AbstractApplicationMote implements Mote { element = new Element("interface_config"); element.setText(moteInterface.getClass().getName()); - Collection interfaceXML = moteInterface.getConfigXML(); + Collection interfaceXML = moteInterface.getConfigXML(); if (interfaceXML != null) { element.addContent(interfaceXML); config.add(element); @@ -203,12 +189,12 @@ public abstract class AbstractApplicationMote implements Mote { return true; } + public int getID() { + return -1; + } + public String toString() { - if (getInterfaces().getMoteID() != null) { - return "Application Mote, ID=" + getInterfaces().getMoteID().getMoteID(); - } else { - return "Application Mote, ID=null"; - } + return "Application Mote, ID=" + getID(); } }