public class SerialPortManipulator extends SimpleManipulator
SimpleDataSource.NameEditorData
DataSource.Writable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
cvsRev |
UPDATE_DISPLAYED_VALUE, VALUE_INPUT
customTimer, EXPORT_READ_ONLY, EXPORT_READ_WRITE, NO_EXPORT, requiresSyncWrite, sharedTimer, syncWriteTimeout, timebase
autoSuspend, AUTOSUSPEND_DEFAULT, AUTOSUSPEND_NEVER, AUTOSUSPEND_NO_LISTENERS, AUTOSUSPEND_NO_LISTENERS_AND_NO_SOURCES, colorHi, colorHiHi, colorLo, colorLoLo, colorNormal, connectors, consoleLogger, currentColor, currentValue, debugLevel, dontConnect, gwtLog, hardSuspended, popupLogger, PRIMARYOUTPORTNAME, sendColors, stopped, suspended, timedPopupLogger, traceLogger, valueHi, valueHiHi, valueLo, valueLoLo
Constructor and Description |
---|
SerialPortManipulator() |
Modifier and Type | Method and Description |
---|---|
int |
available()
This will return the number of bytes available.
|
void |
close()
This will close a port (including all streams).
|
void |
configPorts()
Sets the baud rate, data bits, stop bits and parity for the port.
|
boolean |
connect()
This will open the serial port and so connect to the device.
|
int |
getBaudRate()
This is the baud rate.
|
int |
getDataBits()
This is the data bits.
|
int |
getInterCharacterTimeout()
The inter-character timeout.
|
int |
getParity()
This is the parity.
|
int |
getPort()
This is the port number.
|
int |
getResponseTimeout()
The response timeout.
|
int |
getStopBits()
This is the stop bits.
|
byte |
read()
This will read a single byte.
|
int |
read(byte[] b)
This will read an array of bytes and place them into the given array.
|
int |
read(byte[] b,
int off,
int len)
This will read an array of bytes and place them into the array of bytes
at a given offset (up to the length).
|
byte[] |
readAndWait(int timeout,
int interCharacterTimeout)
This will wait until we have received what the port thinks is everything.
|
void |
refreshCurrentValue()
Poll the port for an unsolicited value.
|
void |
setBaudRate(int newValue)
This is the baud rate.
|
void |
setDataBits(int newValue)
This is the data bits.
|
void |
setInterCharacterTimeout(int interCharacterTimeout)
The inter-character timeout.
|
void |
setParity(int newValue)
This is the parity.
|
void |
setPort(int newValue)
This is the port number.
|
void |
setResponseTimeout(int responseTimeout)
The response timeout.
|
void |
setStopBits(int newValue)
This is the stop bits.
|
void |
write(byte b)
This will write a single byte.
|
void |
write(byte[] b)
This will write a single byte.
|
void |
write(byte[] b,
int offset,
int length)
This will write an array of bytes.
|
getDefaultQualityForLocation
getInPortNames, getStaticLocationFor, setBooleanValue, setBoolValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setShortValue, setStringValue, toString, valueChanged, valueInput
addConnector, addConnector, addDataSource, addPropertyChangeListener, addValueChangedListener, addVetoableChangeListener, authenticatedClientRequest, clientRequest, clientResponse, destroy, determineSuspendedStatus, getClassLicenseManager, getContainer, getCustomTimer, getDataSource, getDataSources, getDisplayName, getExportCriteria, getName, getOutPortNames, getPullFromServers, getPushData, getPushName, getPushToServers, getServerListData, getTimebase, getTrace, isActive, isScreenLocal, removeConnector, removeDataSource, removePropertyChangeListener, removeValueChangedListener, removeVetoableChangeListener, requestSyncWrite, setAutoSuspend, setClassLicenseManager, setContainer, setCustomTimer, setDataSourceName, setExportCriteria, setName, setPullFromServers, setPushData, setPushName, setPushToServers, setScreenLocal, setServerListData, setTimebase, setTrace, setValueObject, start, stop, tick, VIBEvent
addVIBEventListener, checkScript, executeInScriptInternal, executeScript, executeScriptInternal, executeScriptInternal, getAutoSuspend, getBooleanValue, getBoolValue, getColorHi, getColorHiHi, getColorLo, getColorLoLo, getColorNormal, getConnectors, getConsoleLogger, getCurrentColor, getDataSourceName, getDoubleValue, getFloatValue, getGWTLogger, getIncomingValueObject, getInScript, getIntValue, getLongValue, getParent, getPopupLogger, getScript, getSendColors, getSources, getStringValue, getSyncWriteTimeout, getTimedPopupLogger, getTraceLogger, getValueHi, getValueHiHi, getValueLo, getValueLoLo, getValueObject, init, isHardSuspended, isRunning, isSendOnlyChangedValuesDefault, isSuspended, logException, logGWT, logGWT, logMessage, logTrace, n2sortConnectors, popupMessage, post, removeConnector, removeVIBEventListener, replaceConnectors, scriptExtensionSubstition, setColorHi, setColorHiHi, setColorLo, setColorLoLo, setColorNormal, setConsoleLogger, setGWTLogger, setHardSuspended, setInScript, setParent, setPopupLogger, setScript, setSendColors, setSendOnlyChangedValuesDefault, setSyncWriteTimeout, setTimedPopupLogger, setTraceLogger, setValueHi, setValueHiHi, setValueLo, setValueLoLo, updateColor, updateListeners, updateListeners, updateListeners, whoAmI
public static final java.lang.String cvsRev
public int available() throws java.io.IOException
java.io.IOException
public void close()
public void configPorts()
public boolean connect()
public int getBaudRate()
setBaudRate
public int getDataBits()
setDataBits
public int getInterCharacterTimeout()
public int getParity()
setParity
public int getPort()
setPort
public int getResponseTimeout()
public int getStopBits()
setStopBits
public byte read() throws java.io.IOException
java.io.IOException
public int read(byte[] b) throws java.io.IOException
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
public byte[] readAndWait(int timeout, int interCharacterTimeout) throws java.io.IOException
java.io.IOException
public void refreshCurrentValue()
refreshCurrentValue
in class SimpleDataSource
public void setBaudRate(int newValue)
getBaudRate
public void setDataBits(int newValue)
getDataBits
public void setInterCharacterTimeout(int interCharacterTimeout)
public void setParity(int newValue)
getParity
public void setPort(int newValue)
getPort
public void setResponseTimeout(int responseTimeout)
public void setStopBits(int newValue)
getStopBits
public void write(byte b) throws java.io.IOException
java.io.IOException
public void write(byte[] b) throws java.io.IOException
java.io.IOException
public void write(byte[] b, int offset, int length) throws java.io.IOException
java.io.IOException
Copyright © 1999-2021 ErgoTech Systems, Inc. All Rights Reserved.