org.mbari.siam.core
Class SerialDevicePort

java.lang.Object
  extended by org.mbari.siam.core.DevicePort
      extended by org.mbari.siam.core.SerialDevicePort
All Implemented Interfaces:
gnu.io.CommPortOwnershipListener, java.util.EventListener
Direct Known Subclasses:
NVTDevicePort

public class SerialDevicePort
extends DevicePort
implements gnu.io.CommPortOwnershipListener

SerialDevicePort implements DevicePort for a serial device.


Field Summary
 
Fields inherited from class org.mbari.siam.core.DevicePort
_service
 
Fields inherited from interface gnu.io.CommPortOwnershipListener
PORT_OWNED, PORT_OWNERSHIP_REQUESTED, PORT_UNOWNED
 
Constructor Summary
SerialDevicePort(int index, java.lang.String portName, PowerPort powerPort, java.lang.String jar, DeviceService service, CommsMode commsMode)
           
 
Method Summary
 void addCommPortListener()
          Perform a CommPortIdentifier.addPortOwnershipListener()
 void closeComms()
          Close the serial port
 void createInstrumentPort()
          Create the SerialInstrumentPort
 void openComms()
          Open the serial port
 void openComms(int baudRate)
          Open the serial port at a specified baud rate
 void ownershipChange(int type)
          CommPortOwnwershipListener callback.
 
Methods inherited from class org.mbari.siam.core.DevicePort
equals, getCommsMode, getDeviceService, getIndex, getPortName, getPowerPort, hashCode, hasPowerPort, hasPuck, powerDownPort, powerUpPort, setCommsMode, setPowerPort, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SerialDevicePort

public SerialDevicePort(int index,
                        java.lang.String portName,
                        PowerPort powerPort,
                        java.lang.String jar,
                        DeviceService service,
                        CommsMode commsMode)
Method Detail

openComms

public void openComms(int baudRate)
               throws gnu.io.NoSuchPortException,
                      gnu.io.PortInUseException,
                      gnu.io.UnsupportedCommOperationException,
                      java.lang.Exception
Open the serial port at a specified baud rate

Throws:
gnu.io.NoSuchPortException
gnu.io.PortInUseException
gnu.io.UnsupportedCommOperationException
java.lang.Exception

openComms

public void openComms()
               throws gnu.io.NoSuchPortException,
                      gnu.io.PortInUseException,
                      gnu.io.UnsupportedCommOperationException,
                      java.lang.Exception
Open the serial port

Specified by:
openComms in class DevicePort
Throws:
gnu.io.NoSuchPortException
gnu.io.PortInUseException
gnu.io.UnsupportedCommOperationException
java.lang.Exception

closeComms

public void closeComms()
Close the serial port

Specified by:
closeComms in class DevicePort

createInstrumentPort

public void createInstrumentPort()
                          throws InitializeException
Create the SerialInstrumentPort

Specified by:
createInstrumentPort in class DevicePort
Throws:
InitializeException

addCommPortListener

public void addCommPortListener()
Perform a CommPortIdentifier.addPortOwnershipListener()

Overrides:
addCommPortListener in class DevicePort

ownershipChange

public void ownershipChange(int type)
CommPortOwnwershipListener callback.

Specified by:
ownershipChange in interface gnu.io.CommPortOwnershipListener


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.