|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlejos.pc.comm.NXTCommLoggable
lejos.pc.comm.NXTConnector
public class NXTConnector
Connects to a NXT using Bluetooth or USB (or either) and supplies input and output data streams.
Field Summary |
---|
Fields inherited from class lejos.pc.comm.NXTCommLoggable |
---|
fLogListeners |
Constructor Summary | |
---|---|
NXTConnector()
|
Method Summary | |
---|---|
void |
close()
Close the connection |
boolean |
connectTo()
Connect to any NXT over any protocol in PACKET mode |
boolean |
connectTo(int mode)
Connect to any NXT over any protocol specifying mode |
boolean |
connectTo(NXTInfo nxtInfo,
int mode)
Connect to a NXT using a NXTInfo |
boolean |
connectTo(java.lang.String deviceURL)
Connect to a device by URL in packet mode |
boolean |
connectTo(java.lang.String deviceURL,
int mode)
Connect to a device by URL |
boolean |
connectTo(java.lang.String nxt,
java.lang.String addr,
int protocols)
Connect to a specified NXT in packet mode |
boolean |
connectTo(java.lang.String nxt,
java.lang.String addr,
int protocols,
int mode)
Connect to a NXT |
java.io.DataInputStream |
getDataIn()
|
java.io.DataOutputStream |
getDataOut()
|
java.io.InputStream |
getInputStream()
|
NXTComm |
getNXTComm()
|
NXTInfo |
getNXTInfo()
|
NXTInfo[] |
getNXTInfos()
|
java.io.OutputStream |
getOutputStream()
|
NXTInfo[] |
search(java.lang.String nxt,
java.lang.String addr,
int protocols)
Search for a NXT |
void |
setDebug(boolean debug)
Set debugging on or off |
Methods inherited from class lejos.pc.comm.NXTCommLoggable |
---|
addLogListener, log, log, removeLogListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NXTConnector()
Method Detail |
---|
public boolean connectTo()
public boolean connectTo(int mode)
mode
- the NXTComm mode (PACKET, LCP, or RAW)
public boolean connectTo(java.lang.String nxt, java.lang.String addr, int protocols)
nxt
- the name of the NXT to connect to or null for anyaddr
- the address of the NXT to connect to or nullprotocols
- the protocols to use
public NXTInfo[] search(java.lang.String nxt, java.lang.String addr, int protocols)
nxt
- the name of the NXT to connect to or null for anyaddr
- the address of the NXT to connect to or nullprotocols
- the protocols to use
public boolean connectTo(java.lang.String nxt, java.lang.String addr, int protocols, int mode)
nxt
- the name of the NXT to connect to or null for anyaddr
- the address of the NXT to connect to or nullprotocols
- the protocols to use
public boolean connectTo(NXTInfo nxtInfo, int mode)
nxtInfo
- mode
-
public boolean connectTo(java.lang.String deviceURL, int mode)
deviceURL
- mode
- the mode (NXTComm.LCP or NXTComm.PACKET)
public boolean connectTo(java.lang.String deviceURL)
deviceURL
-
public java.io.InputStream getInputStream()
public java.io.DataInputStream getDataIn()
public java.io.OutputStream getOutputStream()
public java.io.DataOutputStream getDataOut()
public NXTInfo getNXTInfo()
public NXTInfo[] getNXTInfos()
public NXTComm getNXTComm()
public void close() throws java.io.IOException
java.io.IOException
public void setDebug(boolean debug)
debug
- true for on, false for off
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |