stella.io
Class DummyRS485
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
io.AbstractDriver
io.AbstractSerialDriver
stella.io.RS485Server
stella.io.CastingRS485Server
stella.io.WatchdogRS485Server
stella.io.PollingRS485Server
stella.io.DummyRS485
- All Implemented Interfaces:
- Driver, Cloneable, Remote, CacheChangedCaster, PollerQuery, RmiSerialCaster, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster
public class DummyRS485
- extends PollingRS485Server
A dummy class for testing event casting by the serial server.
Needs protected blockReadString(java.lang.String, int) and
writeString(java.lang.String) methods in the RS485Server main class.
| Fields inherited from class stella.io.PollingRS485Server |
cache, cachelisten, KEY_ACTIVEDROP, KEY_ACTIVEREAD, KEY_CASTPOLL, KEY_PASSIVEDROP, KEY_PASSIVEREAD, KEY_POLLBASE, KEY_RESPONDMAX, KEY_STARTOPEN, timecurrent, timemax, timemin, validcache |
| Fields inherited from class stella.io.RS485Server |
KEY_CHECKCHAR, KEY_CHECKSUM, KEY_CLOSE, KEY_CR, KEY_ECHO, KEY_FAILTIME, KEY_FAILURES, KEY_INVALID, KEY_MAXBUFFER, KEY_MAXBUSY, KEY_QUERYTIME, KEY_REINIT, KEY_RESPONDTIME, KEY_STARTUP, KEY_TIMEBUSY, lock |
| Fields inherited from class io.AbstractSerialDriver |
inport, KEY_BAUDRATE, KEY_CLOSETIMEOUT, KEY_DATABIT, KEY_FLOWCONTROL, KEY_INBUFFER, KEY_NOTIFYCOOLDOWN, KEY_OUTBUFFER, KEY_PARITYBIT, KEY_PORTNAME, KEY_RECEIVEFRAMING, KEY_RECEIVETHRESHOLD, KEY_RECEIVETIMEOUT, KEY_STOPBIT, KEY_TIMEOUT, outport, staticlock |
| Methods inherited from class stella.io.PollingRS485Server |
addCacheChangedListener, blockChannel, exit, getPollerCache, init, initCache, interleaveCommand, isActive, isPolling, readChannel, removeCacheChangedListener, setActive, setPassive, startPolling, stopPolling, toString, validChannel |
| Methods inherited from class util.PropertyResources |
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from interface util.PropertySupplying |
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
DummyRS485
public DummyRS485(Map prop)
open
public boolean open()
- Always return true.
- Specified by:
open in interface Driver- Overrides:
open in class PollingRS485Server
- Returns:
- True if initialization was successful.
writeString
public String writeString(String blahblah)
- Description copied from class:
RS485Server
- Writes the argumental string to the output stream. The serial port
must be opened prior to calling this method, otherwise writing
will fail. If checksumming is enabled the checksum is calculated from
the command string and added to the transferred byte array imediately
before the terminal
RS485Server.KEY_CR character(s).
Note that this method calls flush on the output stream
after writing the String as a series of bytes to the port.
This method does not synchronize on the serial port! External
synchronization by locking on the RS485Server.lock object is
necessary, if this method is used outside of the RS485Server.writeCommand(java.lang.String)
method.
- Overrides:
writeString in class RS485Server
- Returns:
- The entire string writtn to the port, including chksum and CR
blockReadString
protected String blockReadString(String cmd,
int count)
- For testing. Uncomment for true functionality.
close
public boolean close()
- Returns, there was nothing opened.
- Specified by:
close in interface Driver- Overrides:
close in class PollingRS485Server
- Returns:
- True if clean-up was successful.