stella.io
Class RS485Scan

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by io.AbstractDriver
                  extended by io.AbstractSerialDriver
                      extended by stella.io.RS485ReadWriteServer
                          extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class stella.io.RS485ReadWriteServer
RS485ReadWriteServer.Checksum, RS485ReadWriteServer.Command, RS485ReadWriteServer.Info, RS485ReadWriteServer.ReadWrite, RS485ReadWriteServer.Scan
 
Nested classes/interfaces inherited from class io.AbstractSerialDriver
AbstractSerialDriver.Available
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static char ADDRESS
          The char denoting one address digit in the config command.
private static String DEFCONFIG
          The default config command.
private static int DEFCYCLES
          The default maximum wait cycles.
private static int DEFMAXADDRESS
          The maximum default address to scan.
static String KEY_CONFIG
          The key to config command.
static String KEY_CYCLES
          The key to the maximum address.
static String KEY_MAXADDRESS
          The key to the maximum address.
 
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
 
Fields inherited from class io.AbstractDriver
KEY_DRIVERNAME
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
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 io.AbstractSerialDriver
close, createPortEventListener, createPortEventListener, deregisterSoleEventListener, disableEvent, enableEvent, getDriverName, isOpen, registerSoleEventListener, resetOriginalParameters
 
Methods inherited from class io.AbstractDriver
createDriver, equals, hashCode
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
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 class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
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
 
Methods inherited from interface util.Initializable
init
 

Field Detail

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
Constructor Detail

RS485Scan

public RS485Scan(Map prop)
Constructs a new port scanner.

Method Detail

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.