lejos.pc.comm
Class NXTCommandConnector

java.lang.Object
  extended by lejos.pc.comm.NXTCommandConnector

public class NXTCommandConnector
extends java.lang.Object

Used by remote execution leJOS API classes to create a connection to a NXTCommand (LCP) connection to the NXT.

Author:
Lawrie Griffiths

Constructor Summary
NXTCommandConnector()
           
 
Method Summary
static void close()
           
static NXTCommand getSingletonOpen()
          Ensure that the singleton NXTCommand object has been opened and return it.
static NXTComm open()
          Open any available NXT.
static void setNXTCommand(NXTCommand nxtCommand)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NXTCommandConnector

public NXTCommandConnector()
Method Detail

open

public static NXTComm open()
                    throws java.io.IOException
Open any available NXT.

Returns:
true if connected
Throws:
java.io.IOException

getSingletonOpen

public static NXTCommand getSingletonOpen()
Ensure that the singleton NXTCommand object has been opened and return it. Used by leJOS API remote execution classes. A message is sent to System.err and the program is exited if the open fails.

Returns:
the singleton NXTCommand instance

close

public static void close()
                  throws java.io.IOException
Throws:
java.io.IOException

setNXTCommand

public static void setNXTCommand(NXTCommand nxtCommand)