stella.io
Class RS485Scan
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
io.AbstractDriver
io.AbstractSerialDriver
stella.io.RS485ReadWriteServer
stella.io.RS485Scan
- All Implemented Interfaces:
- Driver, Cloneable, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying
public class RS485Scan
- extends RS485ReadWriteServer
A class that provides the possibility to scan a serial port for connected
RS485 NuDam modules. Starting with hex-address 00 all addresses up to
KEY_MAXADDRESS are scanned in a way that the read-configuration
command KEY_CONFIG is sent for each address, a certain maximum
time-out KEY_CYCLES turns is waited for an incomming reply. If
no reply is received, the next address is scanned. If there was a reply,
the answer is checked and the module found is displayed on the command
line.
| Fields inherited from class stella.io.RS485ReadWriteServer |
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 |
| 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 |
|
Constructor Summary |
RS485Scan(Map prop)
Constructs a new port scanner. |
|
Method Summary |
static void |
main(String[] arg)
Performs a port scan. |
void |
start()
Starts the scan. |
| Methods inherited from class stella.io.RS485ReadWriteServer |
cancelCommand, deferCommand, endCommand, ensureCommand, exit, getCheckSum, getCheckSumming, isReadAlive, isReading, open, readString, setCheckSumming, startCommand, writeCommand, writeString |
| Methods inherited from class util.PropertyResources |
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, 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, toString |
| 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 |
KEY_MAXADDRESS
public static final String KEY_MAXADDRESS
- The key to the maximum address.
- See Also:
- Constant Field Values
KEY_CONFIG
public static final String KEY_CONFIG
- The key to config command.
- See Also:
- Constant Field Values
KEY_CYCLES
public static final String KEY_CYCLES
- The key to the maximum address.
- See Also:
- Constant Field Values
DEFMAXADDRESS
private static final int DEFMAXADDRESS
- The maximum default address to scan.
- See Also:
- Constant Field Values
DEFCONFIG
private static final String DEFCONFIG
- The default config command. Address filled in,
ADDRESS.
- See Also:
- Constant Field Values
DEFCYCLES
private static final int DEFCYCLES
- The default maximum wait cycles.
- See Also:
- Constant Field Values
ADDRESS
private static final char ADDRESS
- The char denoting one address digit in the config command.
- See Also:
- Constant Field Values
RS485Scan
public RS485Scan(Map prop)
- Constructs a new port scanner.
start
public void start()
- Starts the scan. Each module that is responsing is printed to std-out
main
public static void main(String[] arg)
- Performs a port scan. The port must be specified in the properties
at arg[0]. Further version may support command-line switches.