public class NudamConfig extends RS485Server
The class opens the serial port with the current settings, as defined in the
RS485Server class. It reads in the current address (which is, I'd
guess always 00 in DEFAULT mode). The new address, baud rate, input range and
checksum-flag are found in the KEY_NEWADDRESS, the
KEY_NEWBAUD, the KEY_NEWRANGE, and the
KEY_NEWCHECKSUM properties.
After opening the serial port with AbstractSerialDriver.init(), call configure()
followed by AbstractSerialDriver.close() to perform the configuration. Do not forget to
unplug the DEFALUT pin after configuration.
RS485Server.Checksum, RS485Server.Command, RS485Server.Info, RS485Server.ScanAbstractSerialDriver.Available| Modifier and Type | Field and Description |
|---|---|
private static Map |
CODETOBAUD
A look-up table matching NuDam config codes to baud rates.
|
private static String |
DEFADDRESS
The default address is 00 in DEFAULT mode.
|
private static String |
DEFNEWBAUD
The default new baud rate.
|
private static boolean |
DEFNEWCHECKSUM
The default new baud rate.
|
private static String |
DEFNEWRANGE
The default new baud rate.
|
private static Map |
INPUTTOVOLT
A look-up table matching NuDam config codes to input ranges.
|
static String |
KEY_ADDRESS
The key to the current address
|
static String |
KEY_NEWADDRESS
The key to the new address
|
static String |
KEY_NEWBAUD
The key to the new address
|
static String |
KEY_NEWCHECKSUM
The key to the new address
|
static String |
KEY_NEWRANGE
The key to the new address
|
private String |
newbaud
The new baud-rate code.
|
private String |
newrange
The new input-range code.
|
private static Map |
NIBBLETOMODULE
A look-up table matching NuDam read-config data format to NuDam types.
|
private static String |
TRAIL
The set-configuration command trailing character.
|
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, lockinport, 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, LOCK, outport, STATICLOCKKEY_DRIVERNAMEKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASS| Constructor and Description |
|---|
NudamConfig(Map prop)
Constructs a new NuDam configuration tool.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure()
Sends the configure command.
|
static void |
main(String[] arg)
Reads in the new configuration from the properties file supplied as the
first command line argument.
|
deferCommand, ensureCommand, exit, getCheckSum, getCheckSumming, isReading, open, readString, setCheckSumming, toString, writeCommand, writeStringclose, createPortEventListener, createPortEventListener, deregisterSoleEventListener, disableEvent, enableEvent, getDriverName, init, isOpen, registerSoleEventListener, resetOriginalParameterscreateDriver, equals, hashCodeaugment, augment, augment, augment, augment, clone, 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, initProperties, isNew, parseObject, parseObject, reload, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringPropertiespublic static final String KEY_ADDRESS
public static final String KEY_NEWADDRESS
public static final String KEY_NEWBAUD
public static final String KEY_NEWRANGE
public static final String KEY_NEWCHECKSUM
private static final String DEFADDRESS
private static final String DEFNEWBAUD
private static final String DEFNEWRANGE
private static final boolean DEFNEWCHECKSUM
private static final String TRAIL
private static final Map CODETOBAUD
private static final Map INPUTTOVOLT
private static final Map NIBBLETOMODULE
private String newbaud
private String newrange
public NudamConfig(Map prop)
public void configure()
throws IOException
IOExceptionpublic static void main(String[] arg) throws IOException
IOException