Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
e3da-public
contiki-ng
Commits
e4ae215f
Commit
e4ae215f
authored
Oct 06, 2017
by
Niclas Finne
Browse files
Removed COOJA
parent
69579249
Changes
339
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
e4ae215f
...
...
@@ -19,22 +19,14 @@ tools/tunslip
tools/tunslip6
build
tools/coffee-manager/build/
tools/co
oja/dist/
tools/co
ffee-manager/coffee.jar
tools/collect-view/build/
tools/collect-view/dist/
COOJA.testlog
tools/cooja/apps/mrm/lib/
tools/cooja/apps/mspsim/lib/
tools/cooja/apps/powertracker/lib/
tools/cooja/apps/serial_socket/lib/
tools/coffee-manager/coffee.jar
tools/cooja/apps/avrora/lib/cooja_avrora.jar
tools/cooja/apps/collect-view/cooja-collect-view.jar
# platform build artifacts
*.cc2538dk
*.cooja
*.cooja-ip64
*.jn516x
*.native
*.nrf52dk
...
...
@@ -46,7 +38,6 @@ tools/cooja/apps/collect-view/cooja-collect-view.jar
# do not ignore platform makefiles
!Makefile.cc2538dk
!Makefile.cooja
!Makefile.cooja-ip64
!Makefile.jn516x
!Makefile.native
!Makefile.nrf52dk
...
...
tools/cooja/apps/avrora/build.xml
deleted
100644 → 0
View file @
69579249
<?xml version="1.0"?>
<project
name=
"Avrora COOJA support"
default=
"jar"
basedir=
"."
>
<property
name=
"src"
location=
"src"
/>
<property
name=
"build"
location=
"build"
/>
<property
name=
"lib"
location=
"lib"
/>
<property
name=
"javadoc"
location=
"javadoc"
/>
<property
name=
"cooja"
location=
"../.."
/>
<property
name=
"cooja_jar"
value=
"${cooja}/dist/cooja.jar"
/>
<property
name=
"avrora_jar"
value=
"${lib}/avrora-small.jar"
/>
<property
name=
"cooja_avrora_jar"
value=
"${lib}/cooja_avrora.jar"
/>
<target
name=
"init"
>
<tstamp/>
<mkdir
dir=
"${build}"
/>
<mkdir
dir=
"${lib}"
/>
</target>
<target
name=
"clean"
>
<delete
dir=
"${build}"
/>
<delete
file=
"${cooja_avrora_jar}"
/>
</target>
<target
name=
"compile"
depends=
"init"
>
<javac
srcdir=
"${src}"
destdir=
"${build}"
debug=
"on"
includeantruntime=
"false"
>
<classpath>
<pathelement
location=
"${avrora_jar}"
/>
<pathelement
location=
"${cooja_jar}"
/>
<pathelement
location=
"${cooja}/apps/mspsim/build"
/>
</classpath>
</javac>
</target>
<target
name=
"javadoc"
depends=
"compile"
>
<delete
dir=
"${javadoc}"
quiet=
"true"
/>
<mkdir
dir=
"${javadoc}/"
/>
<javadoc
destdir=
"${javadoc}"
>
<fileset
dir=
"${src}/"
includes=
"**/*.java"
/>
<classpath>
<pathelement
location=
"${avrora_jar}"
/>
<pathelement
location=
"${cooja_jar}"
/>
</classpath>
</javadoc>
</target>
<target
name=
"jar"
depends=
"init, compile"
>
<jar
destfile=
"${cooja_avrora_jar}"
basedir=
"${build}"
>
<manifest>
<attribute
name=
"Class-Path"
value=
"."
/>
</manifest>
</jar>
</target>
</project>
tools/cooja/apps/avrora/cooja.config
deleted
100644 → 0
View file @
69579249
org
.
contikios
.
cooja
.
Cooja
.
MOTETYPES
= +
org
.
contikios
.
cooja
.
avrmote
.
MicaZMoteType
org
.
contikios
.
cooja
.
Cooja
.
JARFILES
= +
cooja_avrora
.
jar
avrora
-
small
.
jar
tools/cooja/apps/avrora/lib/avrora-small.jar
deleted
100644 → 0
View file @
69579249
File deleted
tools/cooja/apps/avrora/src/org/contikios/cooja/avrmote/AvrMoteMemory.java
deleted
100644 → 0
View file @
69579249
/*
* Copyright (c) 2014, TU Braunschweig. All rights reserved.
* Copyright (c) 2009, Swedish Institute of Computer Science. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. 2. Redistributions in
* binary form must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution. 3. Neither the name of the
* Institute nor the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package
org.contikios.cooja.avrmote
;
import
org.apache.log4j.Logger
;
import
avrora.arch.avr.AVRProperties
;
import
avrora.core.SourceMapping
;
import
avrora.core.SourceMapping.Location
;
import
avrora.sim.AtmelInterpreter
;
import
avrora.sim.Simulator.Watch
;
import
avrora.sim.State
;
import
java.nio.ByteOrder
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Map
;
import
org.contikios.cooja.mote.memory.MemoryInterface
;
import
org.contikios.cooja.mote.memory.MemoryInterface.SegmentMonitor.EventType
;
import
org.contikios.cooja.mote.memory.MemoryLayout
;
/**
* @author Joakim Eriksson, Fredrik Osterlind, David Kopf, Enrico Jorns
*/
public
class
AvrMoteMemory
implements
MemoryInterface
{
private
static
Logger
logger
=
Logger
.
getLogger
(
AvrMoteMemory
.
class
);
private
static
final
boolean
DEBUG
=
logger
.
isDebugEnabled
();
private
final
SourceMapping
memoryMap
;
private
final
AVRProperties
avrProperties
;
private
final
AtmelInterpreter
interpreter
;
private
final
ArrayList
<
AvrByteMonitor
>
memoryMonitors
=
new
ArrayList
<>();
private
final
MemoryLayout
memLayout
=
new
MemoryLayout
(
ByteOrder
.
LITTLE_ENDIAN
,
MemoryLayout
.
ARCH_8BIT
,
2
);
private
boolean
coojaIsAccessingMemory
;
public
AvrMoteMemory
(
SourceMapping
map
,
AVRProperties
avrProperties
,
AtmelInterpreter
interpreter
)
{
memoryMap
=
map
;
this
.
interpreter
=
interpreter
;
this
.
avrProperties
=
avrProperties
;
}
@Override
public
int
getTotalSize
()
{
return
avrProperties
.
sram_size
;
}
@Override
public
byte
[]
getMemory
()
throws
MoteMemoryException
{
throw
new
UnsupportedOperationException
(
"Not supported yet."
);
//To change body of generated methods, choose Tools | Templates.
}
@Override
public
byte
[]
getMemorySegment
(
long
address
,
int
size
)
throws
MoteMemoryException
{
/*logger.info("getMemorySegment(" + String.format("0x%04x", address) +
", " + size + ")");*/
if
(!
accessInRange
(
address
,
size
))
{
throw
new
MoteMemoryException
(
"Getting memory segment [0x%x,0x%x] failed: Out of range"
,
address
,
address
+
size
-
1
);
}
/* XXX Unsure whether this is the appropriate method to use, as it
* triggers memoryRead monitor. Right now I'm using a flag to indicate
* that Cooja (as opposed to Contiki) read the memory, to avoid infinite
* recursion. */
coojaIsAccessingMemory
=
true
;
byte
[]
data
=
new
byte
[(
int
)
size
];
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
data
[
i
]
=
(
byte
)
(
interpreter
.
getDataByte
((
int
)
address
+
i
)
&
0xff
);
}
coojaIsAccessingMemory
=
false
;
return
data
;
}
@Override
public
void
setMemorySegment
(
long
address
,
byte
[]
data
)
throws
MoteMemoryException
{
if
(!
accessInRange
(
address
,
data
.
length
))
{
throw
new
MoteMemoryException
(
"Writing memory segment [0x%x,0x%x] failed: Out of range"
,
address
,
address
+
data
.
length
-
1
);
}
/* XXX See comment in getMemorySegment. */
coojaIsAccessingMemory
=
true
;
for
(
int
i
=
0
;
i
<
data
.
length
;
i
++)
{
interpreter
.
writeDataByte
((
int
)
address
+
i
,
data
[
i
]);
}
coojaIsAccessingMemory
=
false
;
if
(
DEBUG
)
{
logger
.
debug
(
String
.
format
(
"Wrote memory segment [0x%x,0x%x]"
,
address
,
address
+
data
.
length
-
1
));
}
}
@Override
public
void
clearMemory
()
{
setMemorySegment
(
0L
,
new
byte
[
avrProperties
.
sram_size
]);
}
private
boolean
accessInRange
(
long
address
,
int
size
)
{
return
(
address
>=
0
)
&&
(
address
+
size
<=
avrProperties
.
sram_size
);
}
@Override
public
long
getStartAddr
()
{
return
0
;
// XXX
}
@Override
public
Map
<
String
,
Symbol
>
getSymbolMap
()
{
// XXX do not fetch in function!
Map
<
String
,
Symbol
>
symbols
=
new
HashMap
<>();
for
(
Iterator
<
Location
>
iter
=
memoryMap
.
getIterator
();
iter
.
hasNext
();)
{
Location
loc
=
iter
.
next
();
if
(
loc
==
null
||
(
loc
.
section
.
equals
(
".text"
)))
{
continue
;
}
symbols
.
put
(
loc
.
name
,
new
Symbol
(
Symbol
.
Type
.
VARIABLE
,
loc
.
name
,
loc
.
section
,
loc
.
vma_addr
&
0x7fffff
,
-
1
));
}
return
symbols
;
}
@Override
public
MemoryLayout
getLayout
()
{
return
memLayout
;
}
class
AvrByteMonitor
extends
Watch
.
Empty
{
/** start address to monitor */
final
long
address
;
/** size to monitor */
final
int
size
;
/** Segment monitor to notify */
final
SegmentMonitor
mm
;
/** MonitorType we are listening to */
final
EventType
flag
;
public
AvrByteMonitor
(
long
address
,
int
size
,
SegmentMonitor
mm
,
EventType
flag
)
{
this
.
address
=
address
;
this
.
size
=
size
;
this
.
mm
=
mm
;
this
.
flag
=
flag
;
}
@Override
public
void
fireAfterRead
(
State
state
,
int
data_addr
,
byte
value
)
{
if
(
flag
==
EventType
.
WRITE
||
coojaIsAccessingMemory
)
{
return
;
}
mm
.
memoryChanged
(
AvrMoteMemory
.
this
,
EventType
.
READ
,
data_addr
);
}
@Override
public
void
fireAfterWrite
(
State
state
,
int
data_addr
,
byte
value
)
{
if
(
flag
==
EventType
.
READ
||
coojaIsAccessingMemory
)
{
return
;
}
mm
.
memoryChanged
(
AvrMoteMemory
.
this
,
EventType
.
WRITE
,
data_addr
);
}
}
@Override
public
boolean
addSegmentMonitor
(
EventType
flag
,
long
address
,
int
size
,
SegmentMonitor
mm
)
{
AvrByteMonitor
mon
=
new
AvrByteMonitor
(
address
,
size
,
mm
,
flag
);
memoryMonitors
.
add
(
mon
);
/* logger.debug("Added AvrByteMonitor " + Integer.toString(mon.hashCode()) + " for addr " + mon.address + " size " + mon.size + " with watch" + mon.watch); */
/* Add byte monitor (watch) for every byte in range */
for
(
int
idx
=
0
;
idx
<
mon
.
size
;
idx
++)
{
interpreter
.
getSimulator
().
insertWatch
(
mon
,
(
int
)
mon
.
address
+
idx
);
/* logger.debug("Inserted watch " + Integer.toString(mon.watch.hashCode()) + " for " + (mon.address + idx)); */
}
return
true
;
}
@Override
public
boolean
removeSegmentMonitor
(
long
address
,
int
size
,
SegmentMonitor
mm
)
{
for
(
AvrByteMonitor
mcm
:
memoryMonitors
)
{
if
(
mcm
.
mm
!=
mm
||
mcm
.
address
!=
address
||
mcm
.
size
!=
size
)
{
continue
;
}
for
(
int
idx
=
0
;
idx
<
mcm
.
size
;
idx
++)
{
interpreter
.
getSimulator
().
removeWatch
(
mcm
,
(
int
)
mcm
.
address
+
idx
);
/* logger.debug("Removed watch " + Integer.toString(mcm.watch.hashCode()) + " for " + (mcm.address + idx)); */
}
memoryMonitors
.
remove
(
mcm
);
return
true
;
}
return
false
;
}
}
tools/cooja/apps/avrora/src/org/contikios/cooja/avrmote/MicaZCompileDialog.java
deleted
100644 → 0
View file @
69579249
/*
* Copyright (c) 2012, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
package
org.contikios.cooja.avrmote
;
import
java.awt.Container
;
import
java.io.File
;
import
org.apache.log4j.Logger
;
import
org.contikios.cooja.Cooja
;
import
org.contikios.cooja.MoteInterface
;
import
org.contikios.cooja.MoteType
;
import
org.contikios.cooja.Simulation
;
import
org.contikios.cooja.dialogs.AbstractCompileDialog
;
public
class
MicaZCompileDialog
extends
AbstractCompileDialog
{
private
static
Logger
logger
=
Logger
.
getLogger
(
MicaZCompileDialog
.
class
);
public
static
boolean
showDialog
(
Container
parent
,
Simulation
simulation
,
MoteType
moteType
)
{
final
AbstractCompileDialog
dialog
=
new
MicaZCompileDialog
(
parent
,
simulation
,
moteType
);
/* Show dialog and wait for user */
dialog
.
setVisible
(
true
);
/* BLOCKS */
if
(!
dialog
.
createdOK
())
{
return
false
;
}
/* Assume that if a firmware exists, compilation was ok */
return
true
;
}
private
MicaZCompileDialog
(
Container
parent
,
Simulation
simulation
,
MoteType
moteType
)
{
super
(
parent
,
simulation
,
moteType
);
}
public
Class
<?
extends
MoteInterface
>[]
getAllMoteInterfaces
()
{
return
((
MicaZMoteType
)
moteType
).
getAllMoteInterfaceClasses
();
}
public
Class
<?
extends
MoteInterface
>[]
getDefaultMoteInterfaces
()
{
return
((
MicaZMoteType
)
moteType
).
getAllMoteInterfaceClasses
();
}
public
boolean
canLoadFirmware
(
File
file
)
{
if
(
file
.
getName
().
endsWith
(
".elf"
))
{
return
true
;
}
return
false
;
}
public
String
getDefaultCompileCommands
(
File
source
)
{
/* TODO Split into String[] */
return
/*"make clean TARGET=micaz\n" + */
Cooja
.
getExternalToolsSetting
(
"PATH_MAKE"
)
+
" "
+
getExpectedFirmwareFile
(
source
).
getName
()
+
" TARGET=micaz"
;
}
public
File
getExpectedFirmwareFile
(
File
source
)
{
return
((
MicaZMoteType
)
moteType
).
getExpectedFirmwareFile
(
source
);
}
public
void
writeSettingsToMoteType
()
{
/* Nothing to do */
}
protected
String
getTargetName
()
{
return
"micaz"
;
}
}
tools/cooja/apps/avrora/src/org/contikios/cooja/avrmote/MicaZMote.java
deleted
100644 → 0
View file @
69579249
/*
* Copyright (c) 2007, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
package
org.contikios.cooja.avrmote
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
org.apache.log4j.Logger
;
import
org.jdom.Element
;
import
org.contikios.cooja.Mote
;
import
org.contikios.cooja.MoteInterface
;
import
org.contikios.cooja.MoteInterfaceHandler
;
import
org.contikios.cooja.MoteType
;
import
org.contikios.cooja.Simulation
;
import
org.contikios.cooja.mote.memory.MemoryInterface
;
import
org.contikios.cooja.motes.AbstractEmulatedMote
;
import
avrora.arch.avr.AVRProperties
;
import
avrora.core.LoadableProgram
;
import
avrora.sim.AtmelInterpreter
;
import
avrora.sim.Simulator
;
import
avrora.sim.State
;
import
avrora.sim.mcu.AtmelMicrocontroller
;
import
avrora.sim.mcu.EEPROM
;
import
avrora.sim.platform.MicaZ
;
import
avrora.sim.platform.PlatformFactory
;
import
org.contikios.cooja.avrmote.interfaces.MicaClock
;
/**
* @author Joakim Eriksson, Fredrik Osterlind
*/
public
class
MicaZMote
extends
AbstractEmulatedMote
implements
Mote
{
private
static
Logger
logger
=
Logger
.
getLogger
(
MicaZMote
.
class
);
/* 8 MHz according to Contiki config */
public
static
long
NR_CYCLES_PER_MSEC
=
8000
;
private
MoteInterfaceHandler
myMoteInterfaceHandler
;
private
AtmelMicrocontroller
myCpu
=
null
;
private
MicaZ
micaZ
=
null
;
private
LoadableProgram
program
=
null
;
private
AtmelInterpreter
interpreter
=
null
;
private
AvrMoteMemory
myMemory
=
null
;
private
AVRProperties
avrProperties
=
null
;
private
MicaZMoteType
myMoteType
=
null
;
private
EEPROM
eeprom
=
null
;
private
long
executed
=
0
;
private
long
skipped
=
0
;
/* Stack monitoring variables */
private
boolean
stopNextInstruction
=
false
;
public
MicaZMote
()
{
myMoteType
=
null
;
myCpu
=
null
;
/* TODO myMemory = null; */
myMoteInterfaceHandler
=
null
;
}
public
MicaZMote
(
Simulation
simulation
,
MicaZMoteType
type
)
{
setSimulation
(
simulation
);
myMoteType
=
type
;
/* Schedule us immediately */
requestImmediateWakeup
();
}
protected
boolean
initEmulator
(
File
fileELF
)
{
try
{
prepareMote
(
fileELF
);
}
catch
(
Exception
e
)
{
logger
.
fatal
(
"Error when creating MicaZ mote: "
,
e
);
return
false
;
}
return
true
;
}
/**
* Abort current tick immediately.
* May for example be called by a breakpoint handler.
*/
public
void
stopNextInstruction
()
{
stopNextInstruction
=
true
;
}
private
MoteInterfaceHandler
createMoteInterfaceHandler
()
{
return
new
MoteInterfaceHandler
(
this
,
getType
().
getMoteInterfaceClasses
());
}
public
MicaZ
getMicaZ
()
{
return
micaZ
;
}
protected
void
initMote
()
{
if
(
myMoteType
!=
null
)
{
initEmulator
(
myMoteType
.
getContikiFirmwareFile
());
myMoteInterfaceHandler
=
createMoteInterfaceHandler
();
}
}
/**
* Prepares CPU, memory and ELF module.
*
* @param fileELF ELF file
* @param cpu MSP430 cpu
* @throws Exception
*/
protected
void
prepareMote
(
File
file
)
throws
Exception
{
program
=
new
LoadableProgram
(
file
);
program
.
load
();
PlatformFactory
factory
=
new
MicaZ
.
Factory
();
micaZ
=
(
MicaZ
)
factory
.
newPlatform
(
1
,
program
.
getProgram
());
myCpu
=
(
AtmelMicrocontroller
)
micaZ
.
getMicrocontroller
();
eeprom
=
(
EEPROM
)
myCpu
.
getDevice
(
"eeprom"
);
avrProperties
=
(
AVRProperties
)
myCpu
.
getProperties
();
Simulator
sim
=
myCpu
.
getSimulator
();
interpreter
=
(
AtmelInterpreter
)
sim
.
getInterpreter
();
// State state = interpreter.getState();
myMemory
=
new
AvrMoteMemory
(
program
.
getProgram
().
getSourceMapping
(),
avrProperties
,
interpreter
);
}
public
void
setEEPROM
(
int
address
,
int
i
)
{
byte
[]
eedata
=
eeprom
.
getContent
();
eedata
[
address
]
=
(
byte
)
i
;
}
public
void
setState
(
State
newState
)
{
logger
.
warn
(
"MicaZ motes can't change state"
);