|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.klots.util.NXTFlashUpdate
public class NXTFlashUpdate
Class to allow the updating and verification of the leJOS firmware. The firmware image files can be located inside of jar archives, such as Eclipse plugins, as well as on the file system. This adapted implementation is based on Andy Shaw original code.
Constructor Summary | |
---|---|
NXTFlashUpdate(NXJFlashUI ui)
|
Method Summary | |
---|---|
byte[] |
createFilesystemImage()
Create a memory image for the leJOS file system. |
byte[] |
createFirmwareImage(String vmPath,
String menuPath,
String klotsPath)
Create the memory image ready to be flashed to the device. |
NXTSamba |
openSambaDevice(int timeout)
Locate and open an nxt device in SAM-BA mode. |
void |
rebootDevice(NXTSamba nxt)
|
void |
resetDevice(NXTInfo nxt)
Attempt to restart the nxt in SAM-BA mode. |
void |
updateDevice(NXTSamba nxt,
byte[] memoryImage,
byte[] fs,
boolean verify)
Update the NXT with the new memory image. |
void |
updateDevice(NXTSamba nxt,
byte[] memoryImage,
byte[] fs,
boolean verifyFirm,
boolean verifyFS,
boolean reboot)
Update the NXT with the new memory image. |
int |
verifyFilesystem(NXTSamba nxt,
byte[] fs)
Verify the file system downloaded to the device. |
int |
verifyFirmware(NXTSamba nxt,
byte[] image)
Verify the firmware downloaded to the device. |
int |
verifyPages(NXTSamba nxt,
int first,
byte[] memoryImage)
Verify that the contents of the nxt flash memory match the supplied image. |
void |
writeFilesystem(NXTSamba nxt,
byte[] fs)
Format the nxt file system. |
void |
writeFirmware(NXTSamba nxt,
byte[] memoryImage)
Update the NXT with the new memory image. |
void |
writePages(NXTSamba nxt,
int first,
byte[] memoryImage)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NXTFlashUpdate(NXJFlashUI ui)
ui
- Method Detail |
---|
public byte[] createFirmwareImage(String vmPath, String menuPath, String klotsPath) throws IOException, FileNotFoundException
vmPath
- Relative path to the leJOS VM firmware image in the KLOTS plugin jar file.menuPath
- Relative path to the leJOS menu system firmware image in the KLOTS plugin jar file.klotsPath
- Full path to the KLOTS plugin jar file.
IOException
FileNotFoundException
public byte[] createFilesystemImage()
public NXTSamba openSambaDevice(int timeout) throws NXTCommException, IOException
timeout
-
NXTCommException
IOException
public void resetDevice(NXTInfo nxt) throws NXTCommException, IOException
nxt
- The device to reset
NXTCommException
IOException
public int verifyPages(NXTSamba nxt, int first, byte[] memoryImage) throws IOException
nxt
- device to verifyfirst
- starting addressmemoryImage
- memory address to compare with
IOException
public void writePages(NXTSamba nxt, int first, byte[] memoryImage) throws IOException
nxt
- first
- memoryImage
-
IOException
public void writeFirmware(NXTSamba nxt, byte[] memoryImage) throws IOException
nxt
- Device to update, must be open in SAM-BA mode.memoryImage
- New image for the device
IOException
public void writeFilesystem(NXTSamba nxt, byte[] fs) throws IOException
nxt
- Device to formatfs
- File system image to use
IOException
public int verifyFirmware(NXTSamba nxt, byte[] image) throws IOException
nxt
- device to verifyimage
- firmware image to compare against
IOException
public int verifyFilesystem(NXTSamba nxt, byte[] fs) throws IOException
nxt
- device to verifyimage
- file system image to compare against
IOException
public void rebootDevice(NXTSamba nxt) throws IOException
nxt
-
IOException
public void updateDevice(NXTSamba nxt, byte[] memoryImage, byte[] fs, boolean verify) throws IOException
nxt
- Device to update, must be open in SAM-BA mode.memoryImage
- New firmware image for the devicefs
- File system image.verify
- Should we verify the updates?
IOException
public void updateDevice(NXTSamba nxt, byte[] memoryImage, byte[] fs, boolean verifyFirm, boolean verifyFS, boolean reboot) throws IOException
nxt
- Device to update, must be open in SAM-BA mode.memoryImage
- New firmware image for the devicefs
- File system image.verifyFirm
- Should we verify the firmware updates?verifyFS
- Should we verify the file system updates?reboot
- Reboot after update.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |