|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlejos.pc.charting.LoggerComms
public class LoggerComms
Provides a general connection manager on the PC that
provides an InputStream and OutputStream from/to the NXTDataLogger
running on the NXT.
The InputStream flavor used is a CachingInputStream
which buffers the byte stream from the NXT to minimize
blocking on the NXT writes. The OutputStream is standard.
The connect()
method will attempt to connect via USB first, then Bluetooth via the NXTConnector
class.
DataLogger
,
lejos.util.NXTDataLogger
,
NXTConnector
,
CachingInputStream
Constructor Summary | |
---|---|
LoggerComms()
Create a LoggerComms instance |
Method Summary | |
---|---|
void |
closeConnection()
Flush the streams, close the connection and clean up. |
boolean |
connect(java.lang.String NXT)
Connect to a listening NXT. |
java.lang.String |
getConnectedNXTName()
Return the name of the NXT last successfully connected to. |
java.io.InputStream |
getInputStream()
Return the InputStream from the NXT. |
java.io.OutputStream |
getOutputStream()
Return the OutputStream to the NXT. |
boolean |
isConnected()
Is there a current valid connection? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoggerComms()
Method Detail |
---|
public boolean connect(java.lang.String NXT)
NXTDataLogger
with the waitForConnection()
method called.
NXT
- The name or address of the NXT to connect to. Be aware that NXT names are case-sensitive.
true
if successful connection with Data input/output streams established. false
if the connection failed.lejos.util.NXTDataLogger
public boolean isConnected()
true
if sopublic java.lang.String getConnectedNXTName()
public java.io.InputStream getInputStream()
InputStream
from the NXT.
InputStream
public java.io.OutputStream getOutputStream()
OutputStream
to the NXT.
OutputStream
public void closeConnection()
connect(java.lang.String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |