org.mbari.siam.core
Class PuckSerialInstrumentPort

java.lang.Object
  extended by org.mbari.siam.core.BaseInstrumentPort
      extended by org.mbari.siam.core.SerialInstrumentPort
          extended by org.mbari.siam.core.PuckSerialInstrumentPort
All Implemented Interfaces:
InstrumentPort

public class PuckSerialInstrumentPort
extends SerialInstrumentPort

Implements power control and communications to an instrument via serial port. Assumes a pucked instrument.

Author:
Mike Risi

Field Summary
 
Fields inherited from class org.mbari.siam.core.SerialInstrumentPort
_fromInstrument, _instrumentPortSuspeneded, _serialOpen, _serialPort, _serialPortName, _toInstrument
 
Fields inherited from class org.mbari.siam.core.BaseInstrumentPort
_powerPort
 
Fields inherited from interface org.mbari.siam.core.InstrumentPort
RTS_SENSE
 
Constructor Summary
PuckSerialInstrumentPort(gnu.io.SerialPort serial, java.lang.String serialName, PowerPort power)
          create a PuckSerialInstrumentPort
 
Method Summary
 void connectPower()
          Connect instrument to power.
 void disconnectPower()
          Disconnect instrument power.
 InstrumentDatasheet getDatasheet()
          get the size of the puck payload
 void getPuckAttention()
          get the attention of the puck
 java.io.InputStream getPuckInputStream()
          get an input stream to the puck payload
 byte[] getPuckPayloadMD5()
          get payload MD5 bytes
 int getPuckPayloadSize()
          get the size of the puck payload
 void initialize()
          initialize the InstrumentPort
 boolean isPayloadAvailable()
          returns true is a SIAM payload was found on the PUCK
 boolean isSensorModeSet()
          if the instrument port is talking to the instrument or the puck
 boolean setPuckBaudRate(int baud)
          set the baud rate of the puck
 void setPuckMode()
          put the port into puck mode
 void setSensorMode()
          put the port into sensor mode
 void setSensorMode(boolean force)
          put the port into sensor mode.
 void setSerialPortParams(SerialPortParameters params)
          set the serial port parameters for the serial port associated with this instrument port
 
Methods inherited from class org.mbari.siam.core.SerialInstrumentPort
getCarrierDetectStatus, getClearToSendStatus, getCommPortName, getInputStream, getInstrumentConsole, getOutputStream, getSerialPort, getSerialPortParams, isCTS, resume, sendBreak, setCommsMode, setRTS, shutDown, suspend
 
Methods inherited from class org.mbari.siam.core.BaseInstrumentPort
disableCommunications, enableCommunications, getCurrentLevel, getCurrentLimit, getStatusMessage, getStatusSummaryMessage, getTemperature, getTerseStatus, getVoltageLevel, isolatePort, isSuspended, resetStatus, setCurrentLimit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mbari.siam.core.InstrumentPort
disableCommunications, enableCommunications, getCurrentLevel, getCurrentLimit, getStatusMessage, getStatusSummaryMessage, getTerseStatus, getVoltageLevel, isolatePort, isSuspended, resetStatus, setCurrentLimit
 

Constructor Detail

PuckSerialInstrumentPort

public PuckSerialInstrumentPort(gnu.io.SerialPort serial,
                                java.lang.String serialName,
                                PowerPort power)
create a PuckSerialInstrumentPort

Method Detail

initialize

public void initialize()
                throws InitializeException
initialize the InstrumentPort

Specified by:
initialize in interface InstrumentPort
Overrides:
initialize in class SerialInstrumentPort
Throws:
InitializeException

connectPower

public void connectPower()
Connect instrument to power.

Specified by:
connectPower in interface InstrumentPort
Overrides:
connectPower in class BaseInstrumentPort

disconnectPower

public void disconnectPower()
Disconnect instrument power.

Specified by:
disconnectPower in interface InstrumentPort
Overrides:
disconnectPower in class BaseInstrumentPort

setSerialPortParams

public void setSerialPortParams(SerialPortParameters params)
                         throws java.io.IOException,
                                gnu.io.UnsupportedCommOperationException
set the serial port parameters for the serial port associated with this instrument port

Overrides:
setSerialPortParams in class SerialInstrumentPort
Throws:
java.io.IOException
gnu.io.UnsupportedCommOperationException

getPuckAttention

public void getPuckAttention()
                      throws java.io.IOException
get the attention of the puck

Throws:
java.io.IOException

getPuckInputStream

public java.io.InputStream getPuckInputStream()
                                       throws java.io.IOException
get an input stream to the puck payload

Throws:
java.io.IOException

getDatasheet

public InstrumentDatasheet getDatasheet()
                                 throws java.io.IOException
get the size of the puck payload

Throws:
java.io.IOException

getPuckPayloadSize

public int getPuckPayloadSize()
                       throws java.io.IOException
get the size of the puck payload

Throws:
java.io.IOException

getPuckPayloadMD5

public byte[] getPuckPayloadMD5()
                         throws java.io.IOException
get payload MD5 bytes

Throws:
java.io.IOException

setPuckBaudRate

public boolean setPuckBaudRate(int baud)
                        throws java.io.IOException
set the baud rate of the puck

Throws:
java.io.IOException

setPuckMode

public void setPuckMode()
                 throws java.io.IOException
put the port into puck mode

Throws:
java.io.IOException

setSensorMode

public void setSensorMode()
                   throws java.io.IOException
put the port into sensor mode

Throws:
java.io.IOException

setSensorMode

public void setSensorMode(boolean force)
                   throws java.io.IOException
put the port into sensor mode. If the force parameter is set to true it will attempt to put puck into sensor mode no matter what state the PuckSerialInstrumentPort thinks the puck is in.

Throws:
java.io.IOException

isSensorModeSet

public boolean isSensorModeSet()
if the instrument port is talking to the instrument or the puck


isPayloadAvailable

public boolean isPayloadAvailable()
returns true is a SIAM payload was found on the PUCK



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.