portcomms
Class OpenCommPort

java.lang.Object
  extended by portcomms.OpenCommPort
Direct Known Subclasses:
CommPortModem, PortOwner

public class OpenCommPort
extends java.lang.Object

Open a serial port using Java Communications.


Field Summary
static int BAUD
           
static int[] BITS_PER_SECOND_LIST
           
(package private)  gnu.io.CommPortIdentifier commPortID
          The chosen Port Identifier
protected  boolean debug
          A flag to control debugging output.
static int FLOWCONTROL_HARDWARE
           
static int FLOWCONTROL_NONE
           
static int FLOWCONTROL_XONXOFF
           
protected  java.io.BufferedReader inputStream
          The input stream
protected  java.io.PrintStream outputStream
          The output stream
protected  java.awt.Frame parent
          The parent Frame, for the chooser.
protected  java.lang.String response
          The last line read from the serial port.
static int SERIALPORT_OPEN_TIMEOUTSECONDS
           
(package private)  gnu.io.CommPort thePort
          The chosen Port itself
 
Constructor Summary
OpenCommPort(java.lang.String portName)
           
 
Method Summary
protected  void converse()
          This method will be overridden by non-trivial subclasses to hold a conversation.
 java.lang.String getCommPortName(java.awt.Frame f)
           
static void main(java.lang.String[] argv)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERIALPORT_OPEN_TIMEOUTSECONDS

public static final int SERIALPORT_OPEN_TIMEOUTSECONDS
See Also:
Constant Field Values

BAUD

public static final int BAUD
See Also:
Constant Field Values

FLOWCONTROL_HARDWARE

public static final int FLOWCONTROL_HARDWARE
See Also:
Constant Field Values

FLOWCONTROL_XONXOFF

public static final int FLOWCONTROL_XONXOFF
See Also:
Constant Field Values

FLOWCONTROL_NONE

public static final int FLOWCONTROL_NONE
See Also:
Constant Field Values

BITS_PER_SECOND_LIST

public static final int[] BITS_PER_SECOND_LIST

parent

protected java.awt.Frame parent
The parent Frame, for the chooser.


inputStream

protected java.io.BufferedReader inputStream
The input stream


outputStream

protected java.io.PrintStream outputStream
The output stream


response

protected java.lang.String response
The last line read from the serial port.


debug

protected boolean debug
A flag to control debugging output.


commPortID

gnu.io.CommPortIdentifier commPortID
The chosen Port Identifier


thePort

gnu.io.CommPort thePort
The chosen Port itself

Constructor Detail

OpenCommPort

public OpenCommPort(java.lang.String portName)
             throws java.io.IOException,
                    gnu.io.NoSuchPortException,
                    gnu.io.PortInUseException,
                    gnu.io.UnsupportedCommOperationException
Throws:
java.io.IOException
gnu.io.NoSuchPortException
gnu.io.PortInUseException
gnu.io.UnsupportedCommOperationException
Method Detail

main

public static void main(java.lang.String[] argv)
                 throws java.io.IOException,
                        gnu.io.NoSuchPortException,
                        gnu.io.PortInUseException,
                        gnu.io.UnsupportedCommOperationException
Throws:
java.io.IOException
gnu.io.NoSuchPortException
gnu.io.PortInUseException
gnu.io.UnsupportedCommOperationException

getCommPortName

public java.lang.String getCommPortName(java.awt.Frame f)

converse

protected void converse()
                 throws java.io.IOException
This method will be overridden by non-trivial subclasses to hold a conversation.

Throws:
java.io.IOException