*
* This offset will be used in Cooja in the memory abstraction to match
* Contiki's and Cooja's address spaces */
{
SectionMoteMemory tmp = new SectionMoteMemory(variables);
VarMemory varMem = new VarMemory(tmp);
tmp.addMemorySection("tmp.data", dataSecParser.parse(0));
tmp.addMemorySection("tmp.bss", bssSecParser.parse(0));
try {
int referenceVar = (int) varMem.getVariable("referenceVar").addr;
myCoreComm.setReferenceAddress(referenceVar);
} catch (UnknownVariableException e) {
throw new MoteTypeCreationException("Error setting reference variable: " + e.getMessage(), e);
} catch (RuntimeException e) {
throw new MoteTypeCreationException("Error setting reference variable: " + e.getMessage(), e);
}
getCoreMemory(tmp);
offset = varMem.getIntValueOf("referenceVar") & 0xFFFFFFFFL;
logger.info(getContikiFirmwareFile().getName()
+ ": offsetting Cooja mote address space: 0x" + Long.toHexString(offset));
}
/* Create initial memory: data+bss+optional common */