SunSPOT host API V3.0


com.sun.spot.client
Interface IBootloaderTarget


public interface IBootloaderTarget

IBootloaderTarget allows data to be sent to and from the bootloader executing on a SPOT connected locally. It should be used in the context of executing an ISpotClientCommand and obtained via ISpotManager.getBootloaderTarget()


Method Summary
 void flashBootloader(Flashable flashable, int minHardwareRev, int maxHardwareRev)
          Flash the bootloader.
 void flashBootstrap(Flashable flashable)
          Flash a bootstrap suite.
 void flashConfig(Flashable configPageData)
          Flash the config page
 void flashLib(Flashable flashable, int hash)
          Flash a library suite.
 void flashManufacturingImage(Flashable imageContents)
          Flash a manufacturing image.
 void flashVM(Flashable flashable)
          Flash the VM executable
 byte[] getConfigPageContents()
          Answer the raw data of the config page.
 byte[] readSector(int sectorNumber)
          Return the contents of the given sector in the target's flash memory.
 void reset()
          Restart the SPOT's processor.
 String startAdminVM()
          Start the VM in admin mode: that is, running only the admin processor to deal with commands received via a local connection.
 void startVM()
          Start the VM in normal mode (that is, running an application or the basestation or whatever else has been configured).
 String synchronize()
          Synchronise with the SPOT.
 void upgradePrePurpleBootloader(Flashable bootloaderContents)
          Flash the bootloader of a SPOT whose current bootloader predates the purple release.
 String waitForExit()
          Wait for the VM to exit.
 

Method Detail

flashBootstrap

void flashBootstrap(Flashable flashable)
                    throws IOException
Flash a bootstrap suite.

Parameters:
flashable - the suite contents
Throws:
IOException

flashVM

void flashVM(Flashable flashable)
             throws IOException
Flash the VM executable

Parameters:
flashable - the executable
Throws:
IOException

readSector

byte[] readSector(int sectorNumber)
                  throws IOException
Return the contents of the given sector in the target's flash memory.

Parameters:
sectorNumber -
Returns:
the contents.
Throws:
IOException

flashConfig

void flashConfig(Flashable configPageData)
                 throws IOException
Flash the config page

Parameters:
configPageData -
Throws:
IOException

getConfigPageContents

byte[] getConfigPageContents()
                             throws IOException
Answer the raw data of the config page. Generally should not be used: the normal route to obtaining the ConfigPage is via ISpotClientCommandHelper.getConfigPage().

Returns:
the data
Throws:
IOException

synchronize

String synchronize()
                   throws IOException
Synchronise with the SPOT. After synchronisation, the SPOT may be in admin mode or in the bootloader if connected locally.

Returns:
the bootloader identification string
Throws:
IOException

flashBootloader

void flashBootloader(Flashable flashable,
                     int minHardwareRev,
                     int maxHardwareRev)
                     throws IOException
Flash the bootloader.

Parameters:
flashable - the bootloader contents
minHardwareRev - the lowest hardware revision applicable for this version of the SDK
maxHardwareRev - the highest hardware revision applicable for this version of the SDK
Throws:
IOException

reset

void reset()
           throws IOException
Restart the SPOT's processor. This command will cause the USB interface of the SPOT to be re-enumerated and so the caller should close down the COM port quickly after issuing this command

Throws:
IOException

flashManufacturingImage

void flashManufacturingImage(Flashable imageContents)
                             throws IOException
Flash a manufacturing image.

Parameters:
imageContents - the image contents
Throws:
IOException

startVM

void startVM()
             throws IOException
Start the VM in normal mode (that is, running an application or the basestation or whatever else has been configured).

Throws:
IOException

startAdminVM

String startAdminVM()
                    throws IOException
Start the VM in admin mode: that is, running only the admin processor to deal with commands received via a local connection.

Returns:
the identification string received from the locally connected SPOT's admin command processor
Throws:
IOException

waitForExit

String waitForExit()
                   throws IOException
Wait for the VM to exit. If the VM doesn't request us to abort the SpotClient, then synchronize with the SPOT before returning.

Returns:
null if the VM requested an abort, the bootloader id string if it exited normally.
Throws:
IOException

flashLib

void flashLib(Flashable flashable,
              int hash)
              throws IOException
Flash a library suite.

Parameters:
flashable - the suite contents
hash - the hash of the library suite in canonical form (see Suite.getHash()).
Throws:
IOException

upgradePrePurpleBootloader

void upgradePrePurpleBootloader(Flashable bootloaderContents)
                                throws IOException
Flash the bootloader of a SPOT whose current bootloader predates the purple release.

Parameters:
bootloaderContents -
Throws:
IOException

SunSPOT host API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.