Package jmri.jmrix.dccpp
Class DCCppNetworkPortController
java.lang.Object
jmri.jmrix.AbstractPortController
jmri.jmrix.AbstractNetworkPortController
jmri.jmrix.dccpp.DCCppNetworkPortController
- All Implemented Interfaces:
DCCppPortController,NetworkPortAdapter,PortAdapter
- Direct Known Subclasses:
DCCppEthernetAdapter,DCCppTcpDriverAdapter
public abstract class DCCppNetworkPortController
extends AbstractNetworkPortController
implements DCCppPortController
Base for classes representing a DCCpp communications port
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrix.AbstractPortController
AbstractPortController.Option -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]protected intprotected int[]protected 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
ConstructorsModifierConstructorDescriptionprotectedprotectedDCCppNetworkPortController(DCCppSystemConnectionMemo connectionMemo) -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureOption3(String value) Set the third port option.Get theSystemConnectionMemoassociated with this object.abstract booleanokToSend()Can the port accept additional characters?protected voidCustomizable method to deal with resetting a system connection after a successful recovery of a connection.voidsetCommandStationType(int value) Set config info from the command station type enum.voidsetCommandStationType(String name) Set config info from a name, which needs to be one of the valid ones.voidsetOutputBufferEmpty(boolean s) We need a way to say if the output buffer is empty or notvoidsetTurnoutHandling(String value) abstract booleanstatus()Check that this object is ready to operate.Methods inherited from class jmri.jmrix.AbstractNetworkPortController
autoConfigure, closeConnection, connect, connect, getAdvertisementName, getConnectionTimeout, getCurrentPortName, getHostAddress, getHostName, getInputStream, getMdnsConfigure, getOutputStream, getPort, getServiceType, reconnectFromLoop, 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, setUserNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.jmrix.NetworkPortAdapter
configureMethods inherited from interface jmri.jmrix.PortAdapter
configureOption1, configureOption2, configureOption4, connect, dispose, getDisabled, getInputStream, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, getOutputStream, getReconnectMaxAttempts, getReconnectMaxInterval, getSystemPrefix, getUserName, isDirty, isOptionAdvanced, isOptionTypePassword, isOptionTypeText, isRestartRequired, recover, setDisabled, setManufacturer, setOptionState, setReconnectMaxAttempts, setReconnectMaxInterval, setSystemConnectionMemo, setSystemPrefix, setUserName
-
Field Details
-
commandStationType
-
mTurnoutNoRetry
-
mTurnoutExtraSpace
-
commandStationTypes
-
commandStationNames
-
-
Constructor Details
-
DCCppNetworkPortController
protected DCCppNetworkPortController() -
DCCppNetworkPortController
-
-
Method Details
-
setCommandStationType
Set config info from a name, which needs to be one of the valid ones.- Parameters:
name- exact name of command station type.
-
setCommandStationType
Set config info from the command station type enum.- Parameters:
value- command station type.
-
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
-
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
-
status
Check that this object is ready to operate. This is a question of configuration, not transient hardware status.- Specified by:
statusin interfaceDCCppPortController- Specified by:
statusin interfaceNetworkPortAdapter- Specified by:
statusin interfacePortAdapter- Overrides:
statusin classAbstractPortController- Returns:
- true if OK, at least as far as known
-
okToSend
Can the port accept additional characters? This might go false for short intervals, but it might also stick off if something goes wrong.- Specified by:
okToSendin interfaceDCCppPortController- Returns:
- true if OK to send, else false.
-
setOutputBufferEmpty
Description copied from interface:DCCppPortControllerWe need a way to say if the output buffer is empty or not- Specified by:
setOutputBufferEmptyin interfaceDCCppPortController- Parameters:
s- true to set buffer empty, else false.
-
resetupConnection
Customizable method to deal with resetting a system connection after a successful recovery of a connection.- Overrides:
resetupConnectionin classAbstractNetworkPortController
-