Package jmri.jmrix.dccpp.network
Class DCCppEthernetAdapter
java.lang.Object
jmri.jmrix.AbstractPortController
jmri.jmrix.AbstractNetworkPortController
jmri.jmrix.dccpp.DCCppNetworkPortController
jmri.jmrix.dccpp.network.DCCppEthernetAdapter
- All Implemented Interfaces:
DCCppPortController,NetworkPortAdapter,PortAdapter
Provide access to DCC++ Base Station via Ethernet. NOTES: By default,
the LIUSBEthernet has an IP address of 192.168.0.200 and listens to port
5550. The LIUSBEtherenet disconnects both ports if there is 60 seconds of
inactivity on the port.
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrix.AbstractPortController
AbstractPortController.Option -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) static final String(package private) ZeroConfClientFields inherited from class jmri.jmrix.dccpp.DCCppNetworkPortController
commandStationNames, commandStationType, commandStationTypes, mTurnoutExtraSpace, mTurnoutNoRetryFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSet the server's host name and port using mdns autoconfiguration.voidSet up all of the other objects to operate with a LIUSB Ethernet interface.voidconnect()Open the connection.Get the ZeroConf/mDNS advertisement name.booleanGet whether or not this adapter is configured to use autoconfiguration via MDNS.Get the ZeroConf/mDNS service type.booleanokToSend()Can the port accept additional characters?voidsetMdnsConfigure(boolean autoconfig) Set whether or not this adapter should be configured automatically via MDNS.booleanstatus()Check that this object is ready to operate.Methods inherited from class jmri.jmrix.dccpp.DCCppNetworkPortController
configureOption3, getSystemConnectionMemo, resetupConnection, setCommandStationType, setCommandStationType, setOutputBufferEmpty, setTurnoutHandlingMethods inherited from class jmri.jmrix.AbstractNetworkPortController
closeConnection, connect, getConnectionTimeout, getCurrentPortName, getHostAddress, getHostName, getInputStream, getOutputStream, getPort, reconnectFromLoop, setAdvertisementName, setConnectionTimeout, setHostAddress, setHostName, 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.PortAdapter
configureOption1, configureOption2, configureOption4, 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
-
COMMUNICATION_TCP_PORT
- See Also:
-
DEFAULT_IP_ADDRESS
- See Also:
-
mdnsClient
-
-
Constructor Details
-
DCCppEthernetAdapter
public DCCppEthernetAdapter()
-
-
Method Details
-
connect
Description copied from interface:PortAdapterOpen the connection.- Specified by:
connectin interfacePortAdapter- Overrides:
connectin classAbstractNetworkPortController- Throws:
IOException- if unable to connect
-
okToSend
Can the port accept additional characters?- Specified by:
okToSendin interfaceDCCppPortController- Specified by:
okToSendin classDCCppNetworkPortController- Returns:
- true if the port is opened
-
status
Description copied from class:DCCppNetworkPortControllerCheck 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- Specified by:
statusin classDCCppNetworkPortController- Returns:
- true if OK, at least as far as known
-
configure
Set up all of the other objects to operate with a LIUSB Ethernet interface. -
setMdnsConfigure
Set whether or not this adapter should be configured automatically via MDNS.- Specified by:
setMdnsConfigurein interfaceNetworkPortAdapter- Overrides:
setMdnsConfigurein classAbstractNetworkPortController- Parameters:
autoconfig- boolean value.
-
getMdnsConfigure
Get whether or not this adapter is configured to use autoconfiguration via MDNS.- Specified by:
getMdnsConfigurein interfaceNetworkPortAdapter- Overrides:
getMdnsConfigurein classAbstractNetworkPortController- Returns:
- true if configured using MDNS.
-
autoConfigure
Set the server's host name and port using mdns autoconfiguration.- Specified by:
autoConfigurein interfaceNetworkPortAdapter- Overrides:
autoConfigurein classAbstractNetworkPortController
-
getAdvertisementName
Get the ZeroConf/mDNS advertisement name. this value is fixed on the LIUSB-Ethernet, so return the default value.- Specified by:
getAdvertisementNamein interfaceNetworkPortAdapter- Overrides:
getAdvertisementNamein classAbstractNetworkPortController
-
getServiceType
Get the ZeroConf/mDNS service type. this value is fixed on the LIUSB-Ethernet, so return the default value.- Specified by:
getServiceTypein interfaceNetworkPortAdapter- Overrides:
getServiceTypein classAbstractNetworkPortController
-