SunSPOT host API V3.0


com.sun.spot.client.command
Class ResetLibCommand

java.lang.Object
  extended by com.sun.spot.client.command.AbstractClientCommand
      extended by com.sun.spot.client.command.ResetLibCommand
All Implemented Interfaces:
ISpotClientCommand

public class ResetLibCommand
extends AbstractClientCommand

ResetLibCommand reset the SPOT's library. Normally, libraries should be replaced using FlashLibCommand which is the only way to replace the library on a remote SPOT. However, if a non-functioning library has been inadvertently deployed or the SPOT is otherwise unable to run in admin mode, ResetLibCommand allows the library to be forcibly reflashed. This command will also reset the public key of the SPOT. This command is only available for locally connected SPOTs.


Field Summary
static String NAME
           
 
Fields inherited from interface com.sun.spot.client.command.ISpotClientCommand
SIGNATURE_BOOLEAN, SIGNATURE_INT, SIGNATURE_LONG, SIGNATURE_NOTHING, SIGNATURE_OPTIONAL_SECOND_STRING, SIGNATURE_OPTIONAL_STRING, SIGNATURE_STRING, SIGNATURE_THREE_STRINGS, SIGNATURE_TWO_STRINGS
 
Constructor Summary
ResetLibCommand()
           
 
Method Summary
 Object execute(ISpotClientCommandHelper helper, String name)
          reset the SPOT's library.
protected  String getLibrarySuiteName(ISpotClientCommandHelper helper, String name)
           
 String getName()
           
 int getSignature()
          Answer the signature for execution of the command (see various constants SIGNATURE_...)
 String getUsage()
           
protected  int relocateLibSuite(ISpotClientCommandHelper helper, String suiteFilePath, File binFilePath)
          Relocate the lib suite in suiteFilePath and write it to binFilePath.
 
Methods inherited from class com.sun.spot.client.command.AbstractClientCommand
assertThat, execute, execute, execute, execute, execute, execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

ResetLibCommand

public ResetLibCommand()
Method Detail

execute

public Object execute(ISpotClientCommandHelper helper,
                      String name)
               throws SpotClientException,
                      IOException
reset the SPOT's library. Normally, libraries should be replaced using FlashLibCommand which is the only way to replace the library on a remote SPOT. However, if a non-functioning library has been inadvertently deployed or the SPOT is otherwise unable to run in admin mode, ResetLibCommand allows the library to be forcibly reflashed. This command will also reset the public key of the SPOT.

Specified by:
execute in interface ISpotClientCommand
Overrides:
execute in class AbstractClientCommand
Parameters:
helper - infrastructure-supplied source of command helper operations
name - the fully qualified path to the SDK's current library suite - if null, the value obtainable from ISpotClientCommandHelper.getLibPath() is used
Returns:
null
Throws:
SpotClientException
IOException

getName

public String getName()
Returns:
the command name

getUsage

public String getUsage()
Returns:
a description of how to use the command

relocateLibSuite

protected int relocateLibSuite(ISpotClientCommandHelper helper,
                               String suiteFilePath,
                               File binFilePath)
                        throws IOException,
                               FileNotFoundException
Relocate the lib suite in suiteFilePath and write it to binFilePath. Return the canonical hash of the suite

Throws:
IOException
FileNotFoundException

getLibrarySuiteName

protected String getLibrarySuiteName(ISpotClientCommandHelper helper,
                                     String name)

getSignature

public int getSignature()
Description copied from interface: ISpotClientCommand
Answer the signature for execution of the command (see various constants SIGNATURE_...)

Returns:
the signature identifier

SunSPOT host API V3.0


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