Package jmri.jmrix.loconet
Class LnNetworkPortController
java.lang.Object
jmri.jmrix.AbstractPortController
jmri.jmrix.AbstractNetworkPortController
jmri.jmrix.loconet.LnNetworkPortController
- All Implemented Interfaces:
NetworkPortAdapter,PortAdapter
- Direct Known Subclasses:
LnTcpDriverAdapter
Base for classes representing a LocoNet communications port.
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrix.AbstractPortController
AbstractPortController.Option -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]protected LnCommandStationTypeprotected LnCommandStationType[]protected booleanprotected booleanprotected booleanprotected booleanprotected booleanFields inherited from class jmri.jmrix.AbstractNetworkPortController
connTimeout, m_HostName, m_port, socketConnFields inherited from class jmri.jmrix.AbstractPortController
allowConnectionRecovery, manufacturerName, opened, option1Name, option2Name, option3Name, option4Name, options, reconnectinterval, reconnectMaxAttempts, reconnectMaxInterval -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLnNetworkPortController(LocoNetSystemConnectionMemo connectionMemo) Base class. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureOption3(String value) Set the third port option.voidconnect()While opening, also register a ShutDown item that makes sure the socket is cleanly closed.Get theSystemConnectionMemoassociated with this object.voidsetCommandStationType(String name) Set config info from a name, which needs to be one of the valid ones.voidSet configcommand station type.voidsetInterrogateOnStart(String value) Set whether to interrogate at startupvoidSet whether to use XP slots if available or not.voidsetTranspondingAvailable(String value) Set whether transponding is available.voidsetTurnoutHandling(String value) Methods inherited from class jmri.jmrix.AbstractNetworkPortController
autoConfigure, closeConnection, connect, getAdvertisementName, getConnectionTimeout, getCurrentPortName, getHostAddress, getHostName, getInputStream, getMdnsConfigure, getOutputStream, getPort, getServiceType, reconnectFromLoop, resetupConnection, setAdvertisementName, setConnectionTimeout, setHostAddress, setHostName, setMdnsConfigure, setPort, setPort, setServiceTypeMethods inherited from class jmri.jmrix.AbstractPortController
configureOption1, configureOption2, configureOption4, dispose, getDisabled, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, getReconnectMaxAttempts, getReconnectMaxInterval, getSystemPrefix, getUserName, isDirty, isOptionAdvanced, isOptionTypePassword, isOptionTypeText, isRestartRequired, purgeStream, reconnect, recover, safeSleep, setClosed, setDisabled, setManufacturer, setOpened, setOptionState, setReconnectMaxAttempts, setReconnectMaxInterval, setSystemConnectionMemo, setSystemPrefix, setUserName, statusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.jmrix.NetworkPortAdapter
configure, statusMethods inherited from interface jmri.jmrix.PortAdapter
configureOption1, configureOption2, configureOption4, dispose, getDisabled, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, getReconnectMaxAttempts, getReconnectMaxInterval, getSystemPrefix, getUserName, isDirty, isOptionAdvanced, isOptionTypePassword, isOptionTypeText, isRestartRequired, recover, setDisabled, setManufacturer, setOptionState, setReconnectMaxAttempts, setReconnectMaxInterval, setSystemConnectionMemo, setSystemPrefix, setUserName
-
Field Details
-
commandStationType
-
mTurnoutNoRetry
-
mTurnoutExtraSpace
-
mInterrogateAtStart
-
mTranspondingAvailable
-
mLoconetProtocolAutoDetect
-
commandStationTypes
-
commandStationNames
-
-
Constructor Details
-
LnNetworkPortController
Base class. Implementations will provide InputStream and OutputStream objects to LnTrafficController classes, who in turn will deal in messages.- Parameters:
connectionMemo- associated memo for this connection
-
-
Method Details
-
connect
While opening, also register a ShutDown item that makes sure the socket is cleanly closed.- Specified by:
connectin interfacePortAdapter- Overrides:
connectin classAbstractNetworkPortController- Throws:
IOException- if unable to connect
-
setCommandStationType
Set config info from a name, which needs to be one of the valid ones.- Parameters:
name- the name of the command station
-
setCommandStationType
Set configcommand station type.- Parameters:
value- command station type enum
-
getSystemConnectionMemo
Description copied from class:AbstractPortControllerGet theSystemConnectionMemoassociated with this object.This method should only be overridden to ensure that a specific subclass of SystemConnectionMemo is returned. The recommended pattern is:
public MySystemConnectionMemo getSystemConnectionMemo() { return (MySystemConnectionMemo) super.getSystemConnectionMemo(); }- Specified by:
getSystemConnectionMemoin interfacePortAdapter- Overrides:
getSystemConnectionMemoin classAbstractPortController- Returns:
- the currently associated SystemConnectionMemo
-
setTurnoutHandling
-
setTranspondingAvailable
Set whether transponding is available.- Parameters:
value- either yes or no
-
setLoconetProtocolAutoDetect
Set whether to use XP slots if available or not.- Parameters:
value- either Bundle.getMessage("LoconetProtocolAutoDetect") or no
-
setInterrogateOnStart
Set whether to interrogate at startup- Parameters:
value- either yes or no
-
configureOption3
Set the third port option. Only to be used after construction, but before the openPort call.- Specified by:
configureOption3in interfacePortAdapter- Overrides:
configureOption3in classAbstractPortController- Parameters:
value- to set the option to
-