-there is a possibility that another isolate has written a new value for the property since the current isolate started
-your application has overwritten the
(by executing System.setProperty).
All
Spot.getInstance().getPersistentProperties();
Accessing properties from the host
To view all
ant
To set a property do:
ant
To delete a property do:
ant
Overriding the IEEE address
When it starts up the SPOT loads the system properties from flash memory as described above and then checks whether the property IEEE_ADDRESS has been set. If not, it sets this property to the string representation of the device's serial number. The IEEE 802.15.4 MAC layer uses this property to determine the address that should be adopted by this device. If you wish to set an address different from the serial number then use the facilities described above to set the IEEE_ADDRESS property; this entry will take precedence.
Accessing flash memory
Two mechanisms are provided for reading and writing flash memory.
Using IFlashMemoryDevice
Read and write access to the Sun SPOT's flash memory is via an object conforming to the IFlashMemoryDevice interface. To obtain that object:
IFlashMemoryDevice mem = Spot.getInstance().getFlashMemoryDevice();
The IFlashMemoryDevice interface provides
IFlashMemoryDevice mem = Spot.getInstance().getFlashMemoryDevice(); int startSector = mem.getFirstAvailableSector();
DataOutputStream dos = new DataOutputStream(mem.getOutputStream(startSector, 2)); dos.writeUTF("hello there");
dos.flush();
DataInputStream dis = new DataInputStream(mem.getInputStream(startSector, 2)); String s = dis.readUTF();
The call to open a stream takes two parameters: the first specifies the sector number of the first sector to be read or written. The second parameter specifies the number of contiguous sectors to be allocated to this stream. Opening an output stream erases the data in all the allocated sectors. In the
27