SunSPOT host API V3.0


com.sun.spot.client
Class RemoteLogger

java.lang.Object
  extended by com.sun.spot.client.RemoteLogger
All Implemented Interfaces:
IUI

public class RemoteLogger
extends Object
implements IUI

RemoteLogger. Utility class that assumes a remote SPOT is already executing and redirects its output to System.out.


Constructor Summary
RemoteLogger(String port, String remoteId, int channel, short pan, String keyStorePath, int echoPort)
          Launch a RemoteLogger.
 
Method Summary
 void diagnostic(String msg)
          Callback the SpotClient uses to provide diagnostic messages relating to the operation it's executing.
 void echoFromTarget(String msg)
          Callback the SpotClient uses to echo the output of the target SPOT.
 void info(String msg)
          Callback the SpotClient uses to provide information messages relating to the operation it's executing.
static void main(String[] args)
          Launch a RemoteLogger.
 void newProgress(int initialSteps, int totalSteps, String title)
          Callback the SpotClient uses to announce a new operation for which it will provide progress information.
 void progressEnd(String msg)
          Callback the SpotClient uses to announce the end of the current operation for which it is providing progress information.
 void progressUpdate(int stepsComplete, String msg)
          Callback the SpotClient uses to update progress for lengthy operations.
 void quit()
          RemoteLogger ignores quit and should not be called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteLogger

public RemoteLogger(String port,
                    String remoteId,
                    int channel,
                    short pan,
                    String keyStorePath,
                    int echoPort)
             throws IOException
Launch a RemoteLogger.

Parameters:
port - serial port for talking to a basestation.
remoteId - id of the remote SPOT whose output is to be echoed.
channel - radio channel to use
pan - radio PAN ID to use
keyStorePath - fully qualified path to the key file to use
echoPort - radiostream: port on which to receive output from the remote SPOT. Normally either ISpotAdminConstants.MASTER_ISOLATE_ECHO_PORT or ISpotAdminConstants.CHILD_ISOLATE_ECHO_PORT.
Throws:
IOException
Method Detail

main

public static void main(String[] args)
                 throws IOException
Launch a RemoteLogger. See RemoteLogger(String, String, int, short, String, int) for details about args.

Parameters:
args -
Throws:
IOException

info

public void info(String msg)
Description copied from interface: IUI
Callback the SpotClient uses to provide information messages relating to the operation it's executing.

Specified by:
info in interface IUI
See Also:
IUI.info(java.lang.String)

echoFromTarget

public void echoFromTarget(String msg)
Description copied from interface: IUI
Callback the SpotClient uses to echo the output of the target SPOT.

Specified by:
echoFromTarget in interface IUI
See Also:
IUI.echoFromTarget(java.lang.String)

newProgress

public void newProgress(int initialSteps,
                        int totalSteps,
                        String title)
Description copied from interface: IUI
Callback the SpotClient uses to announce a new operation for which it will provide progress information. Because these operations are assumed to be serialised, there should only ever be one in progress at one time.

Specified by:
newProgress in interface IUI
Parameters:
initialSteps - The number of steps already completed (typically 0)
totalSteps - The total number of steps in the operation
title - Short description of the operation
See Also:
IUI.newProgress(int, int, java.lang.String)

progressUpdate

public void progressUpdate(int stepsComplete,
                           String msg)
Description copied from interface: IUI
Callback the SpotClient uses to update progress for lengthy operations. Note that the totalSteps reported from #newProgress is only an estimate, and so it's possible that stepsComplete may be greater than the last totalSteps. In addition, this may be called at any time. If it's not called after IUI.newProgress(int, int, String) and before IUI.progressEnd(String) then it should be ignored.

Specified by:
progressUpdate in interface IUI
Parameters:
stepsComplete - Progress completed so far
msg - Optional description of the current subtask
See Also:
IUI.progressUpdate(int, java.lang.String)

progressEnd

public void progressEnd(String msg)
Description copied from interface: IUI
Callback the SpotClient uses to announce the end of the current operation for which it is providing progress information.

Specified by:
progressEnd in interface IUI
Parameters:
msg - Optional msg describing final completion
See Also:
IUI.progressEnd(java.lang.String)

diagnostic

public void diagnostic(String msg)
Description copied from interface: IUI
Callback the SpotClient uses to provide diagnostic messages relating to the operation it's executing. These messages might or might not be displayed by the UI.

Specified by:
diagnostic in interface IUI
See Also:
IUI.diagnostic(java.lang.String)

quit

public void quit()
RemoteLogger ignores quit and should not be called.

Specified by:
quit in interface IUI

SunSPOT host API V3.0


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