Package jmri.jmrix.loconet.streamport
Class LnStreamPortController
java.lang.Object
jmri.jmrix.AbstractPortController
jmri.jmrix.AbstractStreamPortController
jmri.jmrix.loconet.streamport.LnStreamPortController
- All Implemented Interfaces:
PortAdapter
- Direct Known Subclasses:
Z21LnStreamPortController
Base for classes representing a LocoNet communications port connected via
streams.
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrix.AbstractPortController
AbstractPortController.Option -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LnCommandStationTypeprotected booleanprotected booleanprotected booleanFields inherited from class jmri.jmrix.AbstractStreamPortController
_name, input, outputFields inherited from class jmri.jmrix.AbstractPortController
allowConnectionRecovery, manufacturerName, opened, option1Name, option2Name, option3Name, option4Name, options, reconnectinterval, reconnectMaxAttempts, reconnectMaxInterval -
Constructor Summary
ConstructorsConstructorDescriptionLnStreamPortController(DataInputStream in, DataOutputStream out, String pname) LnStreamPortController(LocoNetSystemConnectionMemo connectionMemo, DataInputStream in, DataOutputStream out, String pname) -
Method Summary
Modifier and TypeMethodDescriptionvoidSet up all of the other objects to operate with a LocoNet connected via this class.Get theSystemConnectionMemoassociated with this object.booleanokToSend()Can the port accept additional characters?voidSet config info from the Command Station type enum.voidsetInterrogateOnStart(String value) Set whether to interrogate at startupvoidsetTurnoutHandling(String value) booleanstatus()Check that this object is ready to operate.Methods inherited from class jmri.jmrix.AbstractStreamPortController
connect, connect, dispose, getCurrentPortName, getInputStream, getOutputStream, recoverMethods inherited from class jmri.jmrix.AbstractPortController
closeConnection, configureOption1, configureOption2, configureOption3, configureOption4, getDisabled, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, getReconnectMaxAttempts, getReconnectMaxInterval, getSystemPrefix, getUserName, isDirty, isOptionAdvanced, isOptionTypePassword, isOptionTypeText, isRestartRequired, purgeStream, reconnect, reconnectFromLoop, resetupConnection, safeSleep, setClosed, setDisabled, setManufacturer, setOpened, setOptionState, setReconnectMaxAttempts, setReconnectMaxInterval, setSystemConnectionMemo, setSystemPrefix, setUserName
-
Field Details
-
commandStationType
-
mTurnoutNoRetry
-
mTurnoutExtraSpace
-
mInterrogateAtStart
-
-
Constructor Details
-
LnStreamPortController
public LnStreamPortController(LocoNetSystemConnectionMemo connectionMemo, DataInputStream in, DataOutputStream out, String pname) -
LnStreamPortController
-
LnStreamPortController
public LnStreamPortController()
-
-
Method Details
-
status
Check that this object is ready to operate. This is a question of configuration, not transient hardware status.- Specified by:
statusin interfacePortAdapter- Overrides:
statusin classAbstractPortController- Returns:
- true if OK, at least as far as known
-
configure
Set up all of the other objects to operate with a LocoNet connected via this class. -
okToSend
Can the port accept additional characters? This might go false for short intervals, but it might also stick off if something goes wrong.Provide a default implementation for the MS100, etc, in which this is _always_ true, as we rely on the queueing in the port itself.
- Returns:
- always true.
-
setCommandStationType
Set config info from the Command Station type enum.- Parameters:
value- Command Station Type, can be null while switching protocols.
-
setTurnoutHandling
-
setInterrogateOnStart
Set whether to interrogate at startup- Parameters:
value- either yes or no
-
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
-