all mote memories now support symbol addresses

added memory monitor methods (was previously only supported by emulated motes)
This commit is contained in:
Fredrik Osterlind 2012-03-09 14:56:09 +01:00
parent ab39b84010
commit 129a854b54
2 changed files with 12 additions and 24 deletions

View file

@ -31,6 +31,7 @@
package se.sics.cooja;
/**
* This interface represents a mote memory.
*
@ -44,7 +45,7 @@ package se.sics.cooja;
* @see se.sics.cooja.SectionMoteMemory
* @author Fredrik Osterlind
*/
public interface MoteMemory {
public interface MoteMemory extends AddressMemory {
/**
* Clears the entire memory.
@ -77,4 +78,14 @@ public interface MoteMemory {
*/
public int getTotalSize();
public abstract int parseInt(byte[] memorySegment);
public enum MemoryEventType { READ, WRITE };
public interface MemoryMonitor {
public void memoryChanged(MoteMemory memory, MemoryEventType type, int address);
}
public boolean addMemoryMonitor(int address, int size, MemoryMonitor mm);
public void removeMemoryMonitor(int address, int size, MemoryMonitor mm);
}

View file

@ -64,27 +64,4 @@ public abstract class AbstractEmulatedMote extends AbstractWakeupMote implements
public String getStackTrace() {
return null;
}
public interface MemoryMonitor {
public boolean start(int address, int size);
public void stop();
public Mote getMote();
public int getAddress();
public int getSize();
public void setLastBufferAccess(BufferAccess ba);
public BufferAccess getLastBufferAccess();
public boolean isPointer();
public void setPointer(boolean isPointer, MemoryMonitor pointedMemory);
public MemoryMonitor getPointedMemory();
}
public enum MemoryEventType { READ, WRITE, UNKNOWN };
public interface MemoryEventHandler {
public void event(MemoryMonitor mm, MemoryEventType type, int adr, int data);
}
public abstract MemoryMonitor createMemoryMonitor(MemoryEventHandler meh);
}