From 6032f6508fa9501b8610258f647acab9a7fb4068 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 3 Feb 2010 15:11:48 +0000 Subject: [PATCH] using application serial port --- .../se/sics/cooja/motes/AbstractApplicationMote.java | 7 ++++++- .../cooja/motes/AbstractApplicationMoteType.java | 12 +++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/motes/AbstractApplicationMote.java b/tools/cooja/java/se/sics/cooja/motes/AbstractApplicationMote.java index 72c9d65b3..8773d51bc 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.8 2010/01/23 11:26:32 joxe Exp $ + * $Id: AbstractApplicationMote.java,v 1.9 2010/02/03 15:11:48 fros4943 Exp $ */ package se.sics.cooja.motes; @@ -47,6 +47,7 @@ import se.sics.cooja.RadioPacket; import se.sics.cooja.SectionMoteMemory; import se.sics.cooja.Simulation; import se.sics.cooja.interfaces.ApplicationRadio; +import se.sics.cooja.interfaces.ApplicationSerialPort; import se.sics.cooja.interfaces.Radio; /** @@ -96,6 +97,10 @@ public abstract class AbstractApplicationMote extends AbstractWakeupMote impleme requestImmediateWakeup(); } + public void log(String msg) { + ((ApplicationSerialPort)moteInterfaces.getLog()).triggerLog(msg); + } + public MoteInterfaceHandler getInterfaces() { return moteInterfaces; } diff --git a/tools/cooja/java/se/sics/cooja/motes/AbstractApplicationMoteType.java b/tools/cooja/java/se/sics/cooja/motes/AbstractApplicationMoteType.java index 2648acf3d..77c993401 100644 --- a/tools/cooja/java/se/sics/cooja/motes/AbstractApplicationMoteType.java +++ b/tools/cooja/java/se/sics/cooja/motes/AbstractApplicationMoteType.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: AbstractApplicationMoteType.java,v 1.7 2010/02/03 09:28:55 fros4943 Exp $ + * $Id: AbstractApplicationMoteType.java,v 1.8 2010/02/03 15:11:48 fros4943 Exp $ */ package se.sics.cooja.motes; @@ -53,6 +53,7 @@ import se.sics.cooja.ProjectConfig; import se.sics.cooja.Simulation; import se.sics.cooja.interfaces.ApplicationLED; import se.sics.cooja.interfaces.ApplicationRadio; +import se.sics.cooja.interfaces.ApplicationSerialPort; import se.sics.cooja.interfaces.MoteID; import se.sics.cooja.interfaces.Position; @@ -65,8 +66,13 @@ public abstract class AbstractApplicationMoteType implements MoteType { private String identifier = null; private String description = null; - private final Class[] moteInterfaceClasses = - new Class[] { SimpleMoteID.class, Position.class, ApplicationRadio.class, ApplicationLED.class}; + private final Class[] moteInterfaceClasses = new Class[] { + SimpleMoteID.class, + Position.class, + ApplicationSerialPort.class, + ApplicationRadio.class, + ApplicationLED.class + }; public AbstractApplicationMoteType() { super();