diff --git a/tools/cooja/java/org/contikios/cooja/mote/memory/Memory.java b/tools/cooja/java/org/contikios/cooja/mote/memory/Memory.java index f98632179..a308b1f2d 100644 --- a/tools/cooja/java/org/contikios/cooja/mote/memory/Memory.java +++ b/tools/cooja/java/org/contikios/cooja/mote/memory/Memory.java @@ -29,6 +29,8 @@ */ package org.contikios.cooja.mote.memory; +import org.contikios.cooja.mote.memory.MemoryInterface.SegmentMonitor; +import org.contikios.cooja.mote.memory.MemoryInterface.SegmentMonitor.EventType; import org.contikios.cooja.mote.memory.MemoryLayout.DataType; /** @@ -276,4 +278,27 @@ public abstract class Memory { memIntf.setMemorySegment(addr, data); } + /** + * Adds monitor to specified memory region. + * + * @param flag Select memory operation(s) to listen for (read, write, read/write) + * @param addr Start address of monitored region + * @param size Size of monitored region + * @param mm Monitor to add + * @return if monitor could be added, false if not + */ + public boolean addMemoryMonitor(EventType flag, long addr, int size, SegmentMonitor mm) { + return memIntf.addSegmentMonitor(flag, addr, size, mm); + } + + /** + * Removes monitor assigned to the specified region. + * + * @param addr Start address of monitored region + * @param size Size of monitored region + * @param mm Monitor to remove + */ + public void removeMemoryMonitor(long addr, int size, SegmentMonitor mm) { + memIntf.removeSegmentMonitor(addr, size, mm); + } } diff --git a/tools/cooja/java/org/contikios/cooja/mote/memory/VarMemory.java b/tools/cooja/java/org/contikios/cooja/mote/memory/VarMemory.java index ad782c8d7..65cff9af7 100644 --- a/tools/cooja/java/org/contikios/cooja/mote/memory/VarMemory.java +++ b/tools/cooja/java/org/contikios/cooja/mote/memory/VarMemory.java @@ -360,13 +360,12 @@ public class VarMemory extends Memory { } /** - * Adds a MemoryMonitor for the specified address region. + * Adds a monitor for the specified address region. * - * @param flag Select memory operation(s) to listen for (read, write, - * read/write) - * @param varName - * @param mm - * @return + * @param flag Select memory operation(s) to listen for (read, write, read/write) + * @param varName Name of variable to monitor + * @param mm Monitor to add + * @return if monitor could be added, false if not */ public boolean addVarMonitor(EventType flag, final String varName, final SegmentMonitor mm) { return memIntf.addSegmentMonitor( @@ -377,10 +376,10 @@ public class VarMemory extends Memory { } /** - * Removes MemoryMonitor assigned to the specified region. + * Removes monitor assigned to the specified region. * - * @param varName - * @param mm MemoryMonitor to remove + * @param varName Name of monitored variable + * @param mm Monitor to remove */ public void removeVarMonitor(String varName, SegmentMonitor mm) { memIntf.removeSegmentMonitor(getVariable(varName).addr, getVariable(varName).size, mm);