|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcontrol.io.Flash
public class Flash
Raw access to JControls flash memory. The methods are designed to access sectors of memory, not single bytes. Whenever single bytes are to be changed, the sector must be read, changed and rewritten.
The organisation of the flash memory used in the JControl device can be found out
using the
property,
it is organized as <number of sectors>flash.format
x
<bytes per sector>x
<number of banks>
e.g. "512x128x2"
.
all |
Constructor Summary | |
---|---|
Flash()
Constructs a Flash -Object with access to the default bank (of
the current application), is equivalent to Flash(-1) . |
|
Flash(int bank)
Constructs a Flash-Object to a specific bank. |
Method Summary | |
---|---|
int |
getBank()
Returns the number of the bank used by this Flash . |
int |
getUsableSectors()
Get the number of usable sectors. |
int |
read(byte[] data,
int startindex,
int length,
int sector)
Reads a byte array from the Flash. |
int |
write(byte[] data,
int startindex,
int length,
int sector)
Writes a byte array to the Flash. |
Methods inherited from class java.lang.Object |
---|
clone, equals, notifyAll, wait |
Constructor Detail |
---|
public Flash() throws IOException
Flash
-Object with access to the default bank (of
the current application), is equivalent to Flash(-1)
.
IOException
public Flash(int bank) throws IOException
flash.format
property to query the number of available banks. Range is 0 to n-1, use -1
to use the bank of the current application.
bank
- to use, 0 ... n-1 or -1.
IOException
Management
Method Detail |
---|
public int getBank()
Flash
.
public int getUsableSectors()
Flash
bank.
public int read(byte[] data, int startindex, int length, int sector) throws IOException
data
- the byte array to fill with memory datastartindex
- the index to start filling the arraylength
- number of bytes to read into the array; the array is filled from startindex
to
startindex
+length
-1, but not more bytes a sector containssector
- the index of the flash memory sector to read
IOException
public int write(byte[] data, int startindex, int length, int sector) throws IOException
data
- the byte array with data to write to memorystartindex
- the index to start reading the arraylength
- number of bytes to read from the array; the array is read from startindex
to
startindex
+length
-1, but not more bytes a sector containssector
- the index of the flash memory sector to write
IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |