lejos.pc.comm
Class NXTConnectionManager

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

public class NXTConnectionManager
extends java.lang.Object


Constructor Summary
NXTConnectionManager()
           
 
Method Summary
 void addLogListener(NXTCommLogListener listener)
          register log listener
 void closeAll()
           
 boolean connectToBrick(NXTInfo nxtInfo)
          connects to a NXT brick
 void removeLogListener(NXTCommLogListener listener)
          unregister log listener
 NXTInfo[] search()
          searches for available NXT bricks automatically connects to the first one found (TODO: correct?)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NXTConnectionManager

public NXTConnectionManager()
Method Detail

search

public NXTInfo[] search()
searches for available NXT bricks automatically connects to the first one found (TODO: correct?)

Returns:
an array of available NXTInfo objects or null, if no brick is found

connectToBrick

public boolean connectToBrick(NXTInfo nxtInfo)
connects to a NXT brick

Parameters:
nxtInfo -
Returns:
true, if connection was successful

closeAll

public void closeAll()
              throws java.io.IOException
Throws:
java.io.IOException

addLogListener

public void addLogListener(NXTCommLogListener listener)
register log listener

Parameters:
listener - the log listener

removeLogListener

public void removeLogListener(NXTCommLogListener listener)
unregister log listener

Parameters:
listener - the log listener