Sun SPOT API
Green Release  


com.sun.spot.peripheral.basestation
Class BaseStation

java.lang.Object
  extended by java.lang.Thread
      extended by com.sun.spot.peripheral.basestation.BaseStation
All Implemented Interfaces:
Runnable

public class BaseStation
extends Thread

This class implements a base station that allows a PC (the "host") to communicate to a standalone Spot ("the target") through a second Spot (the "base station") connected to the host via a test board and usb cable.

To use, write an application that launches the base station:

...
new BaseStation().initialize();
...

To write applications for the host, use the hostagent jar supplied in the devkit. Target Spots should be addressed directly from the host using their IEEE addresses. The target spots should address the base station's IEEE address - the host doesn't expose an address to the wider network.

This implementation also allows the host to communicate directly other application code running on the base station.

See "Spot Base Station.doc" for further guidance.


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
BaseStation()
           
 
Method Summary
 void initialize()
          Launch the base station listener code that allows communication from host, via base station, to and from remote spots, and from the host directly to the base station.

For Spots this diverts System.out to a sink (for EB40as, we assume that System.out is directed to the second serial port and so does not need to be redirected).
static void main(String[] args)
          A main method that allows this class to be used as a startup class
 void run()
          Should not normally be called by user code - see initialize()
 
Methods inherited from class java.lang.Thread
activeCount, currentThread, getName, getPriority, interrupt, isAlive, join, setPriority, sleep, start, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseStation

public BaseStation()
Method Detail

main

public static void main(String[] args)
                 throws IOException
A main method that allows this class to be used as a startup class

Parameters:
args -
Throws:
IOException

initialize

public void initialize()
                throws IOException
Launch the base station listener code that allows communication from host, via base station, to and from remote spots, and from the host directly to the base station.

For Spots this diverts System.out to a sink (for EB40as, we assume that System.out is directed to the second serial port and so does not need to be redirected).

Throws:
IOException

run

public void run()
Should not normally be called by user code - see initialize()

Specified by:
run in interface Runnable
Overrides:
run in class Thread
Throws:
IOException
See Also:
Thread.start(), Runnable.run()

Sun SPOT API
Green Release  


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