lejos.nxt.remote
Class NXTComm

java.lang.Object
  extended by lejos.nxt.remote.NXTComm
All Implemented Interfaces:
NXTCommRequest

public class NXTComm
extends Object
implements NXTCommRequest

Initiates communication to a remote NXT. Used by NXTCommand to implement the Lego Communications Protocol (LCP) over Bluetooth.


Method Summary
 void close()
          Close the connection
 boolean open(String name, int mode)
           
 byte[] sendRequest(byte[] message, int replyLen)
          Send an LCP message to the NXT and receive a reply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

open

public boolean open(String name,
                    int mode)
             throws IOException
Throws:
IOException

sendRequest

public byte[] sendRequest(byte[] message,
                          int replyLen)
                   throws IOException
Description copied from interface: NXTCommRequest
Send an LCP message to the NXT and receive a reply

Specified by:
sendRequest in interface NXTCommRequest
Parameters:
message - the LCP message
replyLen - the reply length expected
Returns:
the reply
Throws:
IOException

close

public void close()
           throws IOException
Description copied from interface: NXTCommRequest
Close the connection

Specified by:
close in interface NXTCommRequest
Throws:
IOException