|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.mbari.siam.core.BaseInstrumentPort
org.mbari.siam.core.SerialInstrumentPort
public class SerialInstrumentPort
Implements power control and communications to an instrument via serial port. May have a power port.
| Field Summary | |
|---|---|
protected InstrumentPortInputStream |
_fromInstrument
|
protected boolean |
_instrumentPortSuspeneded
|
protected static org.apache.log4j.Logger |
_log4j
Log4j logger |
protected boolean |
_serialOpen
|
protected gnu.io.SerialPort |
_serialPort
|
protected java.lang.String |
_serialPortName
|
protected InstrumentPortOutputStream |
_toInstrument
|
| Fields inherited from class org.mbari.siam.core.BaseInstrumentPort |
|---|
_powerPort |
| Fields inherited from interface org.mbari.siam.core.InstrumentPort |
|---|
RTS_SENSE |
| Constructor Summary | |
|---|---|
SerialInstrumentPort(gnu.io.SerialPort serial,
java.lang.String serialPortName,
PowerPort power)
create a SerialInstrumentPort. |
|
| Method Summary | |
|---|---|
boolean |
getCarrierDetectStatus()
|
boolean |
getClearToSendStatus()
|
java.lang.String |
getCommPortName()
get the commport name |
java.io.InputStream |
getInputStream()
get an InputStream to the instrument |
InstrumentConsole |
getInstrumentConsole()
get a console to an Instrument |
InstrumentPortOutputStream |
getOutputStream()
get an OutputStream to the instrument |
gnu.io.SerialPort |
getSerialPort()
Return serial port. |
SerialPortParameters |
getSerialPortParams()
get the serial port parameters for the serial port associated with this instrument port |
void |
initialize()
initialize the InstrumentPort |
boolean |
isCTS()
get the state of the CTS line |
void |
resume()
resume instrument comms from suspended state |
void |
sendBreak(int duration)
set the TX line to a BREAK condition in 100 ms increments |
void |
setCommsMode(CommsMode commsMode)
Set communications mode (RS422,RS485,RS232) satisfies InstrumentPort interface |
void |
setRTS(boolean state)
set the state of the RTS line |
void |
setSerialPortParams(SerialPortParameters params)
set the serial port parameters for the serial port associated with this instrument port |
void |
shutDown()
shutdown the intrument port. |
void |
suspend()
suspends comms so another application can communicate with the instrument |
| Methods inherited from class org.mbari.siam.core.BaseInstrumentPort |
|---|
connectPower, disableCommunications, disconnectPower, 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 |
|---|
connectPower, disableCommunications, disconnectPower, enableCommunications, getCurrentLevel, getCurrentLimit, getStatusMessage, getStatusSummaryMessage, getTerseStatus, getVoltageLevel, isolatePort, isSuspended, resetStatus, setCurrentLimit |
| Field Detail |
|---|
protected static org.apache.log4j.Logger _log4j
protected gnu.io.SerialPort _serialPort
protected java.lang.String _serialPortName
protected boolean _instrumentPortSuspeneded
protected boolean _serialOpen
protected InstrumentPortInputStream _fromInstrument
protected InstrumentPortOutputStream _toInstrument
| Constructor Detail |
|---|
public SerialInstrumentPort(gnu.io.SerialPort serial,
java.lang.String serialPortName,
PowerPort power)
| Method Detail |
|---|
public void initialize()
throws InitializeException
initialize in interface InstrumentPortinitialize in class BaseInstrumentPortInitializeExceptionpublic void resume()
resume in interface InstrumentPortpublic void suspend()
suspend in interface InstrumentPortpublic void shutDown()
shutDown in interface InstrumentPortshutDown in class BaseInstrumentPort
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface InstrumentPortjava.io.IOExceptionpublic boolean getCarrierDetectStatus()
public boolean getClearToSendStatus()
public InstrumentPortOutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface InstrumentPortjava.io.IOException
public InstrumentConsole getInstrumentConsole()
throws java.io.IOException
getInstrumentConsole in interface InstrumentPortjava.io.IOExceptionpublic java.lang.String getCommPortName()
getCommPortName in interface InstrumentPort
public void setSerialPortParams(SerialPortParameters params)
throws java.io.IOException,
gnu.io.UnsupportedCommOperationException
java.io.IOException
gnu.io.UnsupportedCommOperationException
public SerialPortParameters getSerialPortParams()
throws java.io.IOException,
gnu.io.UnsupportedCommOperationException
java.io.IOException
gnu.io.UnsupportedCommOperationExceptionpublic boolean isCTS()
public void setRTS(boolean state)
public void sendBreak(int duration)
duration - = mS x 250 where mS is required duration to nearest 100mSpublic gnu.io.SerialPort getSerialPort()
public void setCommsMode(CommsMode commsMode)
setCommsMode in interface InstrumentPortsetCommsMode in class BaseInstrumentPort
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||