|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrcx.josx.rcxcomm.RCXAbstractPort
public abstract class RCXAbstractPort
RCXAbstractPort provides an interface similar to java.net.Socket Adapted from original code created by the LEGO3 Team at DTU-IAU RCXAbstractPort implements input and output stream handling and input buffering. It uses a packet handler for sending and receivng packets. This version is abstract because it has no packet handler defined. Specific versions of RCXAbstractPort override the constructor and set up the packet handler to use a specific protocol stack.
Constructor Summary | |
---|---|
RCXAbstractPort(PacketHandler handler)
Constructor for the RCXAbstractPort. |
|
RCXAbstractPort(java.lang.String port,
PacketHandler handler)
Constructor for a named port (eg com1 or usb). |
Method Summary | |
---|---|
void |
close()
Closes this RCXPort, stopping the Listener thread. |
java.io.InputStream |
getInputStream()
Returns an input stream for this RCXPort. |
java.io.OutputStream |
getOutputStream()
Returns an output stream for this RCXPort. |
int |
getTimeOut()
Getter for property timeOut. |
void |
reset()
Resets sequence numbers for this port |
void |
setListen(boolean listen)
Switch listening on and off on the PC, for a serial tower. |
void |
setTimeOut(int timeOut)
Setter for property timeOut. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RCXAbstractPort(PacketHandler handler) throws java.io.IOException
handler
- the packet handler
java.io.IOException
public RCXAbstractPort(java.lang.String port, PacketHandler handler) throws java.io.IOException
port
- the port name, eg com1 or usbhandler,
- the packet handler
java.io.IOException
Method Detail |
---|
public void setListen(boolean listen)
listen
- true to listen, else falsepublic java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
public void reset()
public void close()
public int getTimeOut()
public void setTimeOut(int timeOut)
timeOut
- New value of property timeOut.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |