|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjosx.rcxcomm.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.
Field Summary | |
protected PacketHandler |
packetHandler
|
Constructor Summary | |
RCXAbstractPort(PacketHandler handler)
Constructor for the RCXAbstractPort. |
|
RCXAbstractPort(String port,
PacketHandler handler)
Constructor for a named port (eg com1 or usb). |
Method Summary | |
void |
close()
Closes this RCXPort, stopping the Listener thread. |
InputStream |
getInputStream()
Returns an input stream for this RCXPort. |
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 |
Field Detail |
protected PacketHandler packetHandler
Constructor Detail |
public RCXAbstractPort(PacketHandler handler) throws IOException
handler
- the packet handlerpublic RCXAbstractPort(String port, PacketHandler handler) throws IOException
port
- the port name, eg com1 or usbMethod Detail |
public void setListen(boolean listen)
listen
- true to listen, else falsepublic InputStream getInputStream()
public 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 |