|
SunSPOT host API V5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.spot.suiteconverter.Suite
public class Suite
Suite allows suite files to be saved in a form that can execute directly from SPOT flash memory. Squawk suites are normally saved in "canonical" form, where the base address of the bootstrap suite is assumed to be 0, the base address of child suites to be directly above the last word of the bootstrap suite, and so on for grandchildren. The suites also containg an OOP map that identifies which words are actually pointers. On the desktop, when a suite is loaded into memory, its pointers can then be remapped according to the actual address at which it finds itself, its parent, grandparent, and so on. On the SPOT, this remapping can't happen, as the suites are in flash memory. So instead, we remap them on the host before downloading to the device. This relies on the suites living at known addresses in SPOT virtual memory.
| Field Summary | |
|---|---|
static short |
EXPECTED_SUITE_VERSION_MAJOR
|
static short |
EXPECTED_SUITE_VERSION_MINOR
|
| Constructor Summary | |
|---|---|
Suite()
|
|
| Method Summary | |
|---|---|
int |
getHash()
|
Suite |
getParent()
|
void |
loadFromFile(String filename,
String bootstrapFilename)
Load a suite file from a File. |
void |
loadFromFile(String filename,
String bootstrapFilename,
int[] memoryAddrs)
Deprecated. use loadFromFile(String, String) |
void |
loadFromStream(DataInputStream dis,
String bootstrapFilename)
Load a suite file from a DataInputStream. |
void |
relocateMemory(int[] memoryAddrs)
Relocate the suite's object memory in accordance with the memory addresses supplied |
void |
writeToStream(DataOutputStream dos)
Write the suite to a stream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final short EXPECTED_SUITE_VERSION_MAJOR
public static final short EXPECTED_SUITE_VERSION_MINOR
| Constructor Detail |
|---|
public Suite()
| Method Detail |
|---|
public void loadFromStream(DataInputStream dis,
String bootstrapFilename)
throws IOException
DataInputStream. See also loadFromFile(String, String, int[])
dis - The DataInputStream to read the suite frombootstrapFilename - A filepath to read the bootstrap suite from (note that this is NOT typically
this suite's parent.
IOException
public void writeToStream(DataOutputStream dos)
throws IOException
dos - the data output stream
IOExceptionpublic int getHash()
public void relocateMemory(int[] memoryAddrs)
memoryAddrs - An array of virtual memory addresses at which to assume suites will be mapped on the SPOT
device. The first will be this suite's address, the second its parent, and so on until the the bootstrap address.public Suite getParent()
IOException
public void loadFromFile(String filename,
String bootstrapFilename,
int[] memoryAddrs)
throws IOException
loadFromFile(String, String)
File. See also loadFromStream(DataInputStream, String)
filename - The filepath to read the suite frombootstrapFilename - A filepath to read the bootstrap suite from (note that this is NOT typically
this suite's parent.memoryAddrs - This parameter is ignored and is only present for backwards compatibility.
IOException
public void loadFromFile(String filename,
String bootstrapFilename)
throws IOException
File. See also loadFromStream(DataInputStream, String)
filename - The filepath to read the suite frombootstrapFilename - A filepath to read the bootstrap suite from (note that this is NOT typically
this suite's parent.
IOException
|
SunSPOT host API V5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||