Package lejos.remote.nxt
Class NXTComm
- java.lang.Object
-
- lejos.remote.nxt.NXTComm
-
- All Implemented Interfaces:
NXTCommRequest
public class NXTComm extends java.lang.Object implements NXTCommRequest
Initiates communication to a remote NXT. Used by NXTCommand to implement the Lego Communications Protocol (LCP) over Bluetooth.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the connectionbooleanopen(java.lang.String name, int mode)byte[]sendRequest(byte[] message, int replyLen)Send an LCP message to the NXT and receive a reply
-
-
-
Method Detail
-
open
public boolean open(java.lang.String name, int mode) throws java.io.IOException- Throws:
java.io.IOException
-
sendRequest
public byte[] sendRequest(byte[] message, int replyLen) throws java.io.IOExceptionDescription copied from interface:NXTCommRequestSend an LCP message to the NXT and receive a reply- Specified by:
sendRequestin interfaceNXTCommRequest- Parameters:
message- the LCP messagereplyLen- the reply length expected- Returns:
- the reply
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionDescription copied from interface:NXTCommRequestClose the connection- Specified by:
closein interfaceNXTCommRequest- Throws:
java.io.IOException
-
-