SunSPOT host API V3.0


com.sun.spot.client
Interface ISpotClientCommandHelper

All Known Subinterfaces:
IPrivateCommandHelper

public interface ISpotClientCommandHelper

ISpotClientCommandHelper provides useful facilities to executing ISpotClientCommands.

Developers writing their own ISpotClientCommands will normally be writing admin commands, and should also consider the facilities in the IAdminTarget interface obtainable via getAdminTarget().

See the SPOT Developer's Guide for more details.


Method Summary
 void echoFromTarget(String msg)
          Echo output from the target to the user interface.
 void flashConfig(Flashable configPageData)
          Flash the Config Page with the given data
 IAdminTarget getAdminTarget()
          Get the AdminTarget.
 String getAppName()
           
 String getBootloaderTimeStamp()
           
 ISpotClientCommand getCommand(String commandName)
          Get a named command.
 ConfigPage getConfigPage()
           
 int getDesktopLibraryHash()
           
 byte[] getDesktopPublicKey()
           
 String getDesktopSDKVersion()
           
 String getLibPath()
           
 int getLibraryHash()
           
 File getSysBinPath()
           
 Properties getVersionProperties()
           
 void info(String msg)
          Publish information to the user interface.
 boolean isBootloaderUpToDate()
           
 boolean isRemote()
           
 

Method Detail

getCommand

ISpotClientCommand getCommand(String commandName)
                              throws SpotClientArgumentException
Get a named command. This allows the current ISpotClientCommand to assemble behaviour from other ISpotClientCommands.

Parameters:
commandName - the name of the commad object requested
Returns:
The named ISpotClientCommand.
Throws:
SpotClientArgumentException - if there is no command with the given name.

info

void info(String msg)
Publish information to the user interface. This should be general textual feedback.

Parameters:
msg - the information to publish.

echoFromTarget

void echoFromTarget(String msg)
Echo output from the target to the user interface.

Parameters:
msg - a line of output from the target.

getDesktopPublicKey

byte[] getDesktopPublicKey()
Returns:
The public key of the SD installation.

getLibraryHash

int getLibraryHash()
                   throws IOException
Returns:
the hash of the library installed on device.
Throws:
IOException

getSysBinPath

File getSysBinPath()
Returns:
the fully qualified path to the folder containing arm-specific files (typically /arm)

getLibPath

String getLibPath()
Returns:
the fully qualified path to the SDK's current library suite.

getAppName

String getAppName()
Returns:
the application path specified on the Spot Client command line. Normally this is the relative path from the launch folder of the Spot Client to the suite file of the application, minus the ".suite" extension. If the path is not specified on the command line, it will be the relative path to the launch folder (i.e. ".").

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

getBootloaderTimeStamp

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

getVersionProperties

Properties getVersionProperties()
Returns:
the set of properties defined in the SDK's version.properties file

getDesktopSDKVersion

String getDesktopSDKVersion()
                            throws FileNotFoundException,
                                   IOException
Returns:
the SDK version string of the current SDK
Throws:
FileNotFoundException
IOException

getDesktopLibraryHash

int getDesktopLibraryHash()
                          throws IOException
Returns:
the hash of the current SDK library suite
Throws:
IOException

SunSPOT host API V3.0


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