Package jmri.jmrix.ieee802154.xbee
Class XBeeIOStream
- java.lang.Object
-
- jmri.jmrix.AbstractPortController
-
- jmri.jmrix.ieee802154.xbee.XBeeIOStream
-
- All Implemented Interfaces:
PortAdapter
public final class XBeeIOStream extends AbstractPortController
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrix.AbstractPortController
AbstractPortController.Option
-
-
Field Summary
-
Fields inherited from class jmri.jmrix.AbstractPortController
allowConnectionRecovery, manufacturerName, opened, option1Name, option2Name, option3Name, option4Name, options, reconnectinterval, reconnectMaxAttempts, reconnectMaxInterval
-
-
Constructor Summary
Constructors Constructor Description XBeeIOStream(XBeeNode node, XBeeTrafficController tc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure()
Configure all of the other jmrix widgets needed to work with this adapter.void
connect()
Open the connection.void
dispose()
Clean up before removal.java.lang.String
getCurrentPortName()
boolean
getDisabled()
Return the disabled state of the adapter.java.io.DataInputStream
getInputStream()
Get the InputStream from the port.java.io.DataOutputStream
getOutputStream()
Get the outputStream to the port.void
recover()
This is called when a connection is initially lost.void
setDisabled(boolean disabled)
Set the connection disabled or enabled.boolean
status()
Query the status of this connection.-
Methods inherited from class jmri.jmrix.AbstractPortController
closeConnection, configureOption1, configureOption2, configureOption3, configureOption4, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, getReconnectMaxAttempts, getReconnectMaxInterval, getSystemConnectionMemo, getSystemPrefix, getUserName, isDirty, isOptionAdvanced, isOptionTypePassword, isOptionTypeText, isRestartRequired, purgeStream, reconnect, reconnectFromLoop, resetupConnection, safeSleep, setClosed, setManufacturer, setOpened, setOptionState, setReconnectMaxAttempts, setReconnectMaxInterval, setSystemConnectionMemo, setSystemPrefix, setUserName
-
-
-
-
Constructor Detail
-
XBeeIOStream
public XBeeIOStream(XBeeNode node, XBeeTrafficController tc)
-
-
Method Detail
-
getInputStream
public java.io.DataInputStream getInputStream()
Description copied from class:AbstractPortController
Get the InputStream from the port.- Specified by:
getInputStream
in interfacePortAdapter
- Specified by:
getInputStream
in classAbstractPortController
- Returns:
- the InputStream from the port
-
getOutputStream
public java.io.DataOutputStream getOutputStream()
Description copied from class:AbstractPortController
Get the outputStream to the port.- Specified by:
getOutputStream
in interfacePortAdapter
- Specified by:
getOutputStream
in classAbstractPortController
- Returns:
- the outputStream to the port
-
connect
public void connect()
Description copied from interface:PortAdapter
Open the connection.
-
configure
public void configure()
Description copied from interface:PortAdapter
Configure all of the other jmrix widgets needed to work with this adapter.
-
status
public boolean status()
Description copied from class:AbstractPortController
Query the status of this connection. This is a question of configuration, not transient hardware status.- Specified by:
status
in interfacePortAdapter
- Overrides:
status
in classAbstractPortController
- Returns:
- true if OK, at least as far as known
-
getCurrentPortName
public java.lang.String getCurrentPortName()
- Specified by:
getCurrentPortName
in interfacePortAdapter
- Specified by:
getCurrentPortName
in classAbstractPortController
-
getDisabled
public boolean getDisabled()
Description copied from interface:PortAdapter
Return the disabled state of the adapter.- Specified by:
getDisabled
in interfacePortAdapter
- Overrides:
getDisabled
in classAbstractPortController
- Returns:
- true if disabled
-
setDisabled
public void setDisabled(boolean disabled)
Description copied from class:AbstractPortController
Set the connection disabled or enabled. By default connections are enabled. If the implementing class does not use aSystemConnectionMemo
, this method must be overridden. Overriding methods must callsuper.setDisabled(boolean)
to ensure the configuration change state is correctly set.- Specified by:
setDisabled
in interfacePortAdapter
- Overrides:
setDisabled
in classAbstractPortController
- Parameters:
disabled
- true if connection should be disabled
-
dispose
public void dispose()
Description copied from class:AbstractPortController
Clean up before removal. Overriding methods must callsuper.dispose()
or document why they are not calling the overridden implementation. In most cases, failure to call the overridden implementation will cause user-visible error.- Specified by:
dispose
in interfacePortAdapter
- Overrides:
dispose
in classAbstractPortController
-
recover
public void recover()
Description copied from class:AbstractPortController
This is called when a connection is initially lost. After checking the allowConnectionRecovery flag, closes the connection, resets the open flag and attempts a reconnection.- Specified by:
recover
in interfacePortAdapter
- Overrides:
recover
in classAbstractPortController
-
-