SunSPOT host API V4.0


com.sun.spot.peripheral.radio
Class BasestationManager

java.lang.Object
  extended by com.sun.spot.peripheral.radio.BasestationManager

public class BasestationManager
extends Object

BasestationManager This class manages a basestation SPOT that is to be shared between two or more host processes. It should normally be launched from ant scripts, for example ant start-shared-basestation or ant -Dmulti.process.basestation.sharing=true run If you're developing tools that need to launch this directly, then new BasestationManager().start(false, false); launches normally in the current VM.


Nested Class Summary
static class BasestationManager.DiscoverResult
          The result of discovering a shared basestation
 
Field Summary
static byte CMD_DISCOVER
           
 
Constructor Summary
BasestationManager()
           
 
Method Summary
static BasestationManager.DiscoverResult[] discover()
          Discover all shared basestations
static BasestationManager.DiscoverResult[] discover(String requiredHostIP, String requiredCommsPort, boolean stopAfterFirstReply)
          Discover shared basestations that match the specified host and port
static void main(String[] strings)
          Wrapper to allow launching from command line
 void start(boolean testOnly, boolean dontCreateProxyMac_ForTesting)
          Launch a BasestationManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMD_DISCOVER

public static final byte CMD_DISCOVER
See Also:
Constant Field Values
Constructor Detail

BasestationManager

public BasestationManager()
Method Detail

main

public static void main(String[] strings)
                 throws IOException
Wrapper to allow launching from command line

Parameters:
strings - array of strings, for non-test purposes, an empty array.
Throws:
IOException

start

public void start(boolean testOnly,
                  boolean dontCreateProxyMac_ForTesting)
           throws IOException
Launch a BasestationManager

Parameters:
testOnly - true if only called to test correct creation of MAC layers
dontCreateProxyMac_ForTesting - true if testing does not require access to a SPOT basestation
Throws:
IOException

discover

public static BasestationManager.DiscoverResult[] discover()
                                                    throws IOException
Discover all shared basestations

Returns:
an array of DiscoverResult
Throws:
IOException

discover

public static BasestationManager.DiscoverResult[] discover(String requiredHostIP,
                                                           String requiredCommsPort,
                                                           boolean stopAfterFirstReply)
                                                    throws IOException
Discover shared basestations that match the specified host and port

Parameters:
requiredHostIP - the IP of the host on which the basestation manager is running, or null if you don't care
requiredCommsPort - the port name of the comms port to which the actual basestation is connected, or null if you don't care
stopAfterFirstReply - if true then only return one result
Returns:
an array of DiscoverResult
Throws:
IOException

SunSPOT host API V4.0


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