SunSPOT host API V3.0


com.sun.spot.client
Interface ISpotManager


public interface ISpotManager

ISpotManager is not intended for direct use by new instances of ISpotClientCommand, which should normally use the facilities available via ISpotClientCommandHelper, IAdminTarget and by executing other built-in instances of ISpotClientCommand such as SynchronizeCommand and QuitCommand. The interface to ISpotManager is only used by bootloader commands via IPrivateCommandHelper and is subject to change without notice in future releases.

The ISpotManager has three roles:


Method Summary
 void checkStateForBootloaderCmd()
          Check whether the bootloader or Config Page is obsolete
 void flashConfig(Flashable configPageData)
          Flash the Config Page with the given data
 IAdminTarget getAdminTarget()
          Get the AdminTarget.
 IBootloaderTarget getBootloaderTarget()
          Get the BootloaderTarget.
 String getBootloaderTimeStamp()
           
 ConfigPage getConfigPage()
           
 byte[] getConfigPageContents()
           
 boolean isBootloaderUpToDate()
           
 boolean isRemote()
           
 void quit()
          Quit: release all system resources.
 void setSpotState(SpotState spotState)
          Set the SpotState
 void startVM()
          Start the VM.
 String synchronize()
          Synchronise with a SPOT.
 boolean waitForExit()
          Wait for the VM (assumed to be running) to exit.
 

Method Detail

getConfigPage

ConfigPage getConfigPage()
Returns:
the ISpotManager's cached copy of the SPOT's Config Page

isBootloaderUpToDate

boolean isBootloaderUpToDate()
Returns:
whether the bootloader on the SPOT (or the OTACommanderServer in the case of a remote SPOT) matches the version supplied with the SDK

flashConfig

void flashConfig(Flashable configPageData)
                 throws IOException
Flash the Config Page with the given data

Parameters:
configPageData -
Throws:
IOException

getAdminTarget

IAdminTarget getAdminTarget()
                            throws IOException
Get the AdminTarget. Force the SPOT into admin mode if it's currently at the bootloader prompt.

Returns:
the AdminTarget
Throws:
IOException

isRemote

boolean isRemote()
Returns:
whether the SPOT is remote or locally connected

checkStateForBootloaderCmd

void checkStateForBootloaderCmd()
                                throws SpotObsoleteVersionException
Check whether the bootloader or Config Page is obsolete

Throws:
SpotObsoleteVersionException

setSpotState

void setSpotState(SpotState spotState)
Set the SpotState

Parameters:
spotState -

getBootloaderTarget

IBootloaderTarget getBootloaderTarget()
                                      throws IOException
Get the BootloaderTarget. Force the SPOT to exit if it's currently running the VM in admin mode.

Returns:
the BootloaderTarget
Throws:
IOException

quit

void quit()
          throws IOException
Quit: release all system resources.

Throws:
IOException

getConfigPageContents

byte[] getConfigPageContents()
                             throws IOException
Returns:
the raw contents of the config page from the device
Throws:
IOException

synchronize

String synchronize()
                   throws IOException
Synchronise with a SPOT. If the SPOT is locally connected and already in admin mode, leave it there, otherwise force it to the bootloader prompt.

Returns:
The identification string obtained from the SPOT
Throws:
IOException

startVM

void startVM()
             throws IOException
Start the VM. If the SPOT is local and at the bootloader prompt, just start it. If the SPOT is local and in admin mode then force the admin mode to exit and start the VM. If the SPOT is remote then restart it and resynchronize afterwards.

Throws:
IOException

waitForExit

boolean waitForExit()
                    throws IOException
Wait for the VM (assumed to be running) to exit.

Returns:
whether the VM requested the SpotClient to abort.
Throws:
IOException

getBootloaderTimeStamp

String getBootloaderTimeStamp()
Returns:
answer the timestamp portion of the bootloader's identification string.

SunSPOT host API V3.0


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