Class RCXAbstractPort

  • Direct Known Subclasses:
    RCXPort

    public abstract class RCXAbstractPort
    extends java.lang.Object
    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.
    Author:
    Brian Bagnall, Lawrie Griffiths
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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 setTimeOut​(int timeOut)
      Setter for property timeOut.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RCXAbstractPort

        public RCXAbstractPort​(PacketHandler handler)
                        throws java.io.IOException
        Constructor for the RCXAbstractPort. Opens the port, and sets the protocol packet handler.
        Parameters:
        handler - the packet handler
        Throws:
        java.io.IOException
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
        Returns an input stream for this RCXPort.
        Returns:
        an input stream for reading bytes from this RCXPort.
      • getOutputStream

        public java.io.OutputStream getOutputStream()
        Returns an output stream for this RCXPort.
        Returns:
        an output stream for writing bytes to this RCXPort.
      • reset

        public void reset()
        Resets sequence numbers for this port
      • close

        public void close()
        Closes this RCXPort, stopping the Listener thread.
      • getTimeOut

        public int getTimeOut()
        Getter for property timeOut.
        Returns:
        Value of property timeOut.
      • setTimeOut

        public void setTimeOut​(int timeOut)
        Setter for property timeOut.
        Parameters:
        timeOut - New value of property timeOut.